Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

explain_fprintf_or_die(3) [debian man page]

explain_fprintf_or_die(3)				     Library Functions Manual					 explain_fprintf_or_die(3)

NAME
explain_fprintf_or_die - formatted output conversion and report errors SYNOPSIS
#include <libexplain/fprintf.h> int explain_fprintf_or_die(FILE *fp, const char *format, ...); int explain_fprintf_on_error(FILE *fp, const char *format, ...); DESCRIPTION
The explain_fprintf_or_die function is used to call the fprintf(3) system call. On failure an explanation will be printed to stderr, obtained from the explain_fprintf(3) function, and then the process terminates by calling exit(EXIT_FAILURE). The explain_fprintf_on_error function is used to call the fprintf(3) system call. On failure an explanation will be printed to stderr, obtained from the explain_fprintf(3) function, but still returns to the caller. fp The fp, exactly as to be passed to the fprintf(3) system call. format The format, exactly as to be passed to the fprintf(3) system call. RETURN VALUE
The explain_fprintf_or_die function only returns on success, see fprintf(3) for more information. On failure, prints an explanation and exits, it does not return. The explain_fprintf_on_error function always returns the value return by the wrapped fprintf(3) system call. EXAMPLE
The explain_fprintf_or_die function is intended to be used in a fashion similar to the following example: int result = explain_fprintf_or_die(fp, format, ...); SEE ALSO
fprintf(3) formatted output conversion explain_fprintf(3) explain fprintf(3) errors exit(2) terminate the calling process COPYRIGHT
libexplain version 0.52 Copyright (C) 2010 Peter Miller explain_fprintf_or_die(3)

Check Out this Related Man Page

explain_readlink_or_die(3)				     Library Functions Manual					explain_readlink_or_die(3)

NAME
explain_readlink_or_die - read value of a symbolic link and report errors SYNOPSIS
#include <libexplain/readlink.h> ssize_t explain_readlink_or_die(const char *pathname, char *data, size_t data_size); ssize_t explain_readlink_on_error(const char *pathname, char *data, size_t data_size)) DESCRIPTION
The explain_readlink_or_die function is used to call the readlink(2) system call. On failure an explanation will be printed to stderr, obtained from the explain_readlink(3) function, and then the process terminates by calling exit(EXIT_FAILURE). The explain_readlink_on_error function is used to call the readlink(2) system call. On failure an explanation will be printed to stderr, obtained from the explain_readlink(3) function, but still returns to the caller. pathname The pathname, exactly as to be passed to the readlink(2) system call. data The data, exactly as to be passed to the readlink(2) system call. data_size The data_size, exactly as to be passed to the readlink(2) system call. RETURN VALUE
The explain_readlink_or_die function only returns on success, see readlink(2) for more information. On failure, prints an explanation and exits, it does not return. The explain_readlink_on_error function always returns the value return by the wrapped readlink(2) system call. EXAMPLE
The explain_readlink_or_die function is intended to be used in a fashion similar to the following example: ssize_t result = explain_readlink_or_die(pathname, data, data_size); SEE ALSO
readlink(2) read value of a symbolic link explain_readlink(3) explain readlink(2) errors exit(2) terminate the calling process COPYRIGHT
libexplain version 0.52 Copyright (C) 2009 Peter Miller explain_readlink_or_die(3)
Man Page

6 More Discussions You Might Find Interesting

1. Programming

Max file size can't exceed 2 GB

We have Sun OS 5.9 we are doing a backup process (ProC program) that uses the function... fprintf(fp,"%s;%s;%s;%s;%s;%ld;%ld;%ld;%ld;%s;%s;%s;%d;%s;%s;%s;%ld;%s;%s;%s;%ld;%ld;%s;%ld;%s;%ld;%s;%s;%c%c",x_contrno, x_subno, x_b_subno,x_transdate,x_last_traffic_date,BillAmt_s, x_billamount_int,... (10 Replies)
Discussion started by: atiato
10 Replies

2. Programming

stderr in background process

Herez the question, In a process which writes into file FILE1 with descriptor fHandler1 and it is run as a background process where would statements be directed when stderr descriptor is used. fprintf(stderr,"some message\n"); assume that session from which it is run is terminated and... (3 Replies)
Discussion started by: matrixmadhan
3 Replies

3. Programming

Clarify me.

Dear all, I know the use of fprintf and typecasting. But, in the following function call what is the use? why that is type casted to void? (void) fprintf(stderr, "Enter key: "); (1 Reply)
Discussion started by: nagalenoj
1 Replies

4. Programming

fprintf

Could someone explain me the following fprintf format: fprintf (stderr, _("Try `%s --help' for more information.\n"), program_name); Why just not use: fprintf(stderr, "ry `%s --help' for more information.\n", program_name) I mean what is _() does? (1 Reply)
Discussion started by: mirusnet
1 Replies

5. Linux

Can background process access to stdout,stderr

Hi folks :) Can deamonized process access to stderr, stdout? I 'm trying to display error_num/return value of a function run() in stderr using fprintf(stderr, "function run() returns = %d", ret_val); run() is called after deamonizing the process. (1 Reply)
Discussion started by: katty
1 Replies

6. Programming

fprintf() gives segmentation fault

Hi, I am using fprintf to write few strings toa file which has been opened in write mode. The syntax is as follows: printf("Testing 7A.\n"); fprintf(out_screen,"%s|%s|%s|%s|%s|\n",var1,var2,var3,var4,var5); printf("Testing 8.\n"); When I execute the code It prints "Testing 7A." then... (2 Replies)
Discussion started by: siba.s.nayak
2 Replies