That function uses all kinds of things you don't define anywhere and you still aren't telling me what it's supposed to do.
I can see lots of obvious errors in it though -- first and foremost you never actually allocate memory for 'init', so you're just feeding a null into your initialize_descr, you copy around pointers as if that changes their contents(it doesn't) and you attempt to read from NULL with init->newfd.
Your initialize_descr function seems strange too:
I think you're trying to append to the end of the list, right? In which case:
Last edited by Corona688; 09-29-2011 at 01:59 PM..
:cool: I like Vibhory2 like the idea of tapping into the kernel.. although not as indepth as he/she... i want to create a virtual databse of a few ma chines with connectivity and defiinte knowledge to create it.. I havebeen working on the project for a year now.. ! before unix (1 year exactly) i... (20 Replies)
I installed Oracle 10 software on Solaris 11 Express, everything was fine execpt I can't create database using dbca.rsp file. I populated file with following options.
OPERATION_TYPE = "createDatabase"
GDBNAME = "solaris_user.domain.com"
SID = "solaris_user"
TEMPLATENAME = "General... (0 Replies)
Hi,
I have backup file of database in my server. I want to create a that database in the same Mysql Server. How can I do that?
Please send the steps to create the database using backup file?
Thanks a lot, (1 Reply)
Hi.
I have two text files(tables) which include some information and I want to make some query codes using them.
First of all, I want to create bash script that read this two tables, create/open database and insert data from files into database.
#!/bin/bash
while read line; do
... (1 Reply)
Hello ,
I am new in this forum and need your help as I am totally confused :confused:
I read a lot of threads and tried to search a lot but did not get the exact answer to my question.
I just want a simple (content wise may be long) shell script to create oracle database.
In detail:... (5 Replies)
#!/bin/bash
user=`mysql userList -uuserlist -puserlistpassword -s -N -e "SELECT userName FROM users WHERE activated='n'"`
for i in $user; do
useradd "$i" -m
doneThis is what I have done so far. But obviously it still does not work.
I'm trying to create users based on information stored in a... (5 Replies)
Hi all,
I new to scripting and i need to know how to put the script when the capture goes down in the feeds database.. I tried with this "ps -ef | grep asn" command and it displaying the capture,apply time. But the alert we are receving now is replication is failed . So i need to develop the... (1 Reply)
Hello,
Please suggest me the ways how to get graphical interface on AIX server.I need to create oracle database for which I need graphical access.
Best regards,
Vishal (4 Replies)
Hi Guys,
I have a list a hotels stored in many different text files.
This list is kept in the following format:
20/03
Hotel:
The Bear Hotel
Honey Street
Woodstock
UK
Tel:+44-xxxxxx
Rate: 100
21/03
Hotel:
The Bush Hotel
Nice Street
Farnham (4 Replies)
Discussion started by: freddie50
4 Replies
LEARN ABOUT DEBIAN
dynarr
DYNARR(3pub) C Programmer's Manual DYNARR(3pub)NAME
dynarr, dynarr_init, dynarr_resize, dynarr_free - simple dynamic arrays
SYNOPSIS
#include <publib.h>
void dynarr_init(struct dynarr *da, size_t elsize);
int dynarr_resize(struct dynarr *da, size_t newsize);
void dynarr_free(struct dynarr *da);
DESCRIPTION
These functions make it easier to use dynamic arrays, i.e., arrays that are allocated with malloc(3) and resized with realloc(3). Below is
a typical code fragment for implementing a dynamic array that is resized as more input is read.
char *p, *line;
size_t alloc, len;
len = 0;
alloc = 1024;
if ((line = malloc(alloc)) == NULL) abort();
while (fgets(line + len, alloc-len, stdin) != NULL) {
len = strlen(line);
alloc += 1024;
if ((p = realloc(alloc)) == NULL) abort();
alloc = p;
}
(The error handling is intentionally simplified.) Below is the above fragment with the dynarr(3).
struct dynarr da;
dynarr_init(&da);
while (fgets((char *)da.data + da.used, da.alloc-da.len, stdin) != NULL) {
da.used = strlen(da.data);
if (dynarr_resize(&da, da.alloc + 1024) == -1) abort();
}
The code is a bit simpler, and all the memory allocation details and most of the error checking code is hidden away.
The dynamic array is represented by a struct dynarr:
struct dynarr {
void *data;
size_t alloc, used;
};
The interface to the dynamic allocation has intentionally been made unopaque.
dynarr_init initializes a struct dynarr to be an empty array, dynarr_resize sets its size to be newsize, and dynarr_free frees the array
(it will become an empty array again).
RETURNS
dynarr_resize returns -1 if it failed, 0 if it succeeded. It does not change the array in any way if it failed.
SEE ALSO publib(3), malloc(3), realloc(3), strdup(3)AUTHOR
Lars Wirzenius (lars.wirzenius@helsinki.fi)
Publib C Programmer's Manual DYNARR(3pub)