Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

array_fail(3) [debian man page]

array_fail(3)						     Library Functions Manual						     array_fail(3)

NAME
array_fail - switch array to have failed SYNTAX
#include <array.h> void array_fail(array* x); array x; array_fail(&x); DESCRIPTION
If x is allocated, array_fail frees the region that x points to, and switches x to have failed. If x is unallocated, array_fail simply switches x to have failed. If x has already failed, array_fail has no effect. SEE ALSO
array_allocate(3), array_reset(3) array_fail(3)

Check Out this Related Man Page

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)
Man Page

11 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

DBD::ODBC::st fetchrow_hashref failed: [unixODBC][Oracle][ODBC]Numeric value out of r

Here is part of my program code: #Collect the output of test database and count the no #of rows too while(my @array = $tstDbStatementHandle->fetchrow_array) { push @tstDbOutputArray,; $tstDbOutputRows++; } ... (3 Replies)
Discussion started by: sameerstephen
3 Replies

2. Shell Programming and Scripting

Database access

Hell all, I have the following snippet of code: $sql=qq{select * from ( select to_char(t.start_time_timestamp,'yyyy/mm/dd hh24:mi:ss') start_time,t.s_p_number_address, null cos_icsa_code, null cos_icsa_subcode from cc_unrated_msc_flow t union select... (2 Replies)
Discussion started by: chriss_58
2 Replies

3. Solaris

EMC Failover

Hi guys, I'm running vxdmp and powerpath at the same time. Vxdmp for internal disks and powerpath for external. The problem is that, on the failover tests which a fiber cable should be removed, the system cannot recognize the disks. Any hints on how to configure powerpath in order to... (4 Replies)
Discussion started by: glenioborges
4 Replies

4. Emergency UNIX and Linux Support

Mapping between "Pseudo name" and "Logical device ID" in powerpath with SVM changed....

Dear All, I was having powerpath 5.2 on SUN server with SVM connected to CLARIION box.Please find the following output : root # powermt display dev=all Pseudo name=emcpower3a CLARiiON ID=CK200073400372 Logical device ID=60060160685D1E004DD97FB647BFDC11 state=alive; policy=CLAROpt;... (1 Reply)
Discussion started by: Reboot
1 Replies

5. UNIX for Dummies Questions & Answers

I welcome all to answer my Q's

Hi everyone,, I am new to the forum...but not to Unix. I have gathered few questions from my mates who attended interviews in various companies as I have to attend one on dec 3rd for Sys admin position. Please respond with the answers you know and also help with various other interview... (2 Replies)
Discussion started by: impawan
2 Replies

6. Shell Programming and Scripting

Solaris Server dectects EMC dead path and send mail immediately

taus-itcapp1#powermt display dev=all Pseudo name=emcpower0a CLARiiON ID=APM00105201788 Logical device ID=60060160B2202B001094F0E0AF5CE011 state=alive; policy=CLAROpt; priority=0; queued-IOs=0; Owner: default=SP A, current=SP A Array failover mode: 1 ... (6 Replies)
Discussion started by: orafup
6 Replies

7. Programming

Multiple children and single pipe

Greetings everyone, I need a bit of help in solving the following problem: I'm given an array of numbers and I have to compute the sum of the array elements using n processes, and the inter process communication has to be done with pipes(one pipe, to be exact). I managed to solve the problem... (14 Replies)
Discussion started by: ephesos
14 Replies

8. Linux

EMC, PowerPath and issue on using LUN

Hello guys, I'm going crazy over here with a problem with a LUN created on a EMC CX3. I did sucessfully managed to create the LUN on the Storage (the LUN is named DBLNX25EC_TST), after doing the following process: echo "1" > /sys/class/fc_host/host<n>/issue_lip and echo "- - -" >... (10 Replies)
Discussion started by: Zarnick
10 Replies

9. Solaris

FCP_dev showing as failing

Hi, Setup - V880, Solaris 9, Multipathing(Powerpath), Zoned Fabric, EMC CX4960........ no volume manager The following disks are showing as failing when running the following. Both disks are online, one is a snapshot of our Oracle DR the other is hosting a production database. #... (0 Replies)
Discussion started by: jamba1
0 Replies

10. Shell Programming and Scripting

Weird Perl error using db2.

I have having a heck of a time figuring this out so any help is much appreciated. Here is the code where it seems to be dying, I bolded the part it is complaining about: $sth = $dbh->prepare( $query ) or die "error with query\n"; $sth->execute() or die "error executing query ...\n"; while(... (1 Reply)
Discussion started by: savigabi
1 Replies

11. Shell Programming and Scripting

From perl program query is not executed.

I have tried executing one particular query through perl.But I am unable to get the result. When I tried to execute the sysdate query its working when I executed my perl code. The below query doesn't work. QUERY 1:my $sql ="select name from tab where rownum <6"; Received ora error... (23 Replies)
Discussion started by: ramkumar15
23 Replies