1explain_pwrite_or_die(3)   Library Functions Manual   explain_pwrite_or_die(3)
2
3
4

NAME

6       explain_pwrite_or_die  - seek and write to a file descriptor and report
7       errors
8

SYNOPSIS

10       #include <libexplain/pwrite.h>
11       ssize_t explain_pwrite_or_die(int  fildes,  const  void  *data,  size_t
12       data_size, off_t offset);
13       ssize_t  explain_pwrite_on_error(int  fildes,  const void *data, size_t
14       data_size, off_t offset))
15

DESCRIPTION

17       The explain_pwrite_or_die function is used to call the pwrite(2) system
18       call.  On  failure  an  explanation will be printed to stderr, obtained
19       from the explain_pwrite(3) function, and then the process terminates by
20       calling exit(EXIT_FAILURE).
21
22       The explain_pwrite_on_error function is used to call the pwrite(2) sys‐
23       tem call. On failure an explanation will be printed to stderr, obtained
24       from the explain_pwrite(3) function, but still returns to the caller.
25
26       fildes  The  fildes,  exactly  as  to be passed to the pwrite(2) system
27               call.
28
29       data    The data, exactly as to be passed to the pwrite(2) system call.
30
31       data_size
32               The data_size, exactly as to be passed to the pwrite(2)  system
33               call.
34
35       offset  The  offset,  exactly  as  to be passed to the pwrite(2) system
36               call.
37

RETURN VALUE

39       The  explain_pwrite_or_die  function  only  returns  on  success,   see
40       pwrite(2)  for  more information. On failure, prints an explanation and
41       exits, it does not return.
42
43       The explain_pwrite_on_error function always returns the value return by
44       the wrapped pwrite(2) system call.
45

EXAMPLE

47       The  explain_pwrite_or_die function is intended to be used in a fashion
48       similar to the following example:
49              ssize_t result = explain_pwrite_or_die(fildes, data, data_size, offset);
50

SEE ALSO

52       pwrite(2)
53               read from or write to a file descriptor at a given offset
54
55       explain_pwrite(3)
56               explain pwrite(2) errors
57
58       exit(2) terminate the calling process
59
61       libexplain version 1.4
62       Copyright (C) 2009 Peter Miller
63
64
65
66                                                      explain_pwrite_or_die(3)
Impressum