Professional Web Applications Themes

Why fopen fail because of EINTR? - UNIX Programming

[email]no.spamunix.net[/email] (Andrew Josey) writes: >> How about POSIX and older X/Open standards? >POSIX.1, 2003 Edition is the same as the latest Single UNIX Specification >and has it as a mandatory CX extension over ISO C. Its always >harder to understand the earlier POSIX.1's since they just reference >the ISO C standard and state that the underlying function is open(); True for many aspects of stdio function behaviour. However, on the question of whether errno must be set by stdio functions, the earlier POSIX.1's were crystal clear: POSIX.1-1990 section 8.2.3.11 Error Reporting "If any of the functions above return an error ...

  1. #1

    Default Re: Why fopen fail because of EINTR?

    [email]no.spamunix.net[/email] (Andrew Josey) writes:
    >> How about POSIX and older X/Open standards?
    >POSIX.1, 2003 Edition is the same as the latest Single UNIX Specification
    >and has it as a mandatory CX extension over ISO C. Its always
    >harder to understand the earlier POSIX.1's since they just reference
    >the ISO C standard and state that the underlying function is open();
    True for many aspects of stdio function behaviour. However, on
    the question of whether errno must be set by stdio functions, the
    earlier POSIX.1's were crystal clear:

    POSIX.1-1990 section 8.2.3.11 Error Reporting

    "If any of the functions above return an error indication, the
    value of errno shall be set to indicate the error condition."

    --
    Geoff Clare <nospamgclare.org.uk>
    Geoff Clare Guest

  2. #2

    Default Re: Why fopen fail because of EINTR?

    [email]vekstation02.ohout.pharmapartners.nl[/email] (Villy Kruse) writes:
    >AT&T unix System V release 3 appears to set errno only of the syscall
    >open() fails and thereby sets the errno. If you for example repeatedly
    >call fdopen() you will eventualy get a return value of NULL and errno
    >remains untouched. The man page from SVR3 does not mention errno at
    >all for fopen(); a failure is only indicated by return NULL.
    >It is not unreasonable to assume that early SVR4 and Solaris inherited
    >the same behaviour from SVR3.
    The assumption, although not unreasonable, happens to be false.

    One of the major changes that happened between SVR3 and SVR4 was
    POSIX compliance, and POSIX tightened up the behaviour of the
    stdio functions with regard to setting errno. (See my other post
    in this thread for the POSIX.1-1990 quote).

    --
    Geoff Clare <nospamgclare.org.uk>
    Geoff Clare Guest

Similar Threads

  1. using an array with FOPEN?
    By Wayne... in forum PHP Development
    Replies: 5
    Last Post: July 11th, 05:33 PM
  2. fopen
    By Chris Grigor in forum PHP Development
    Replies: 1
    Last Post: September 25th, 03:55 PM
  3. file() and fopen()
    By Andrzej in forum PHP Development
    Replies: 1
    Last Post: August 20th, 12:01 PM
  4. Help Please in using fopen in PHP
    By Webmanhouse@aol.com in forum PHP Development
    Replies: 2
    Last Post: August 11th, 12:33 PM
  5. url fopen
    By David de Kloet in forum PHP Development
    Replies: 0
    Last Post: June 26th, 06:41 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139