From: Carlos O'Donell <carlos@baldric.uwo.ca>
To: Randolph Chung <randolph@tausq.org>
Cc: Jochen Friedrich <jochen@scram.de>,
HP900 PARISC mailing list <parisc-linux@lists.parisc-linux.org>
Subject: [parisc-linux] HPUX guru needed -> definition of EWOULDBLOCK in /usr/include/asm/errno.h
Date: Tue, 10 Sep 2002 12:18:29 -0400 [thread overview]
Message-ID: <20020910161829.GD2732@systemhalted> (raw)
In-Reply-To: <20020909220448.GP17893@tausq.org>
>
> On some SysV systems EAGAIN != EWOULDBLOCK. I think we inherited the
> errno definitions from HPUX...
>
> glibc's documentation says:
>
> Portability Note: In many older Unix systems, this condition was indicated by EWOULDBLOCK, which was a distinct error code different from EAGAIN. To make your program portable, you should check for both codes and treat them the same.
>
> sounds like good advice to me.. :-)
>
> it does say, however, that for glibc EWOULDBLOCK and EAGAIN should have
> the same value though, so i guess ours is wrong... i wonder if we'll
> break things if we changed it.
>
> randolph
I agree with randolph, you should change the code to check for EAGAIN aswell.
On the other hand...
We have to do both of the following in order to maintain backwards compatibility.
I'm all for ignoring that and just doing 'b' :}
a. Emulate EWOULDBLOCK == EAGAIN in assembly during syscall errors.
- Added code to glibc :(
See:
glibc-2.2.5/sysdeps/unix/i386/sysdep.S
glibc-2.2.5/sysdeps/unix/sparc/sysdep.S
glibc-2.2.5/sysdeps/unix/x86_64/sysdep.S
glibc-2.2.5/sysdeps/unix/arm/sysdep.S
...
b. Just change the kernel header to alias EWOULDBLOCK as EAGAIN.
--- linux/include/asm-parisc/errno.h 1999-12-24 12:05:04.000000000 -0500
+++ linux/include/asm-parisc/errno.h.new 2002-09-10 12:09:52.000000000 -0400
@@ -134,7 +134,7 @@
#define EALREADY 244 /* Operation already in progress */
#define EINPROGRESS 245 /* Operation now in progress */
-#define EWOULDBLOCK 246 /* Operation would block (Linux returns EAGAIN) */
+#define EWOULDBLOCK EAGAIN /* Operation would block (Linux returns EAGAIN) */
#define ENOTEMPTY 247 /* Directory not empty */
#define ENAMETOOLONG 248 /* File name too long */
#define ELOOP 249 /* Too many symbolic links encountered */
This seems best since I don't really see any code in ioctl32.c that returns
EWOULDBLOCK :) We just confuse the applicaiton by providing a different value.
Does this have anything to do with HPUX compatibility? Would an HPUX application
expect different semantic meansings from these two values?
c.
next prev parent reply other threads:[~2002-09-10 16:18 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-09-09 21:46 [parisc-linux] definition of EWOULDBLOCK in /usr/include/asm/errno.h Jochen Friedrich
2002-09-09 22:04 ` Randolph Chung
2002-09-10 16:18 ` Carlos O'Donell [this message]
2002-09-10 20:22 ` Jochen Friedrich
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20020910161829.GD2732@systemhalted \
--to=carlos@baldric.uwo.ca \
--cc=jochen@scram.de \
--cc=parisc-linux@lists.parisc-linux.org \
--cc=randolph@tausq.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.