delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/06/17/12:52:30

Date: Tue, 17 Jun 1997 09:49:45 -0700 (PDT)
Message-Id: <199706171649.JAA19455@adit.ap.net>
Mime-Version: 1.0
To: djgpp AT delorie DOT com
From: Nate Eldredge <eldredge AT ap DOT net>
Subject: Possible misbehavior of write

Is there a "correct" thing for write() to do when passed a null buffer? This
code:

write(fd,NULL,count);

...assuming reasonable values for fd and count, under Linux returns -1 and
sets errno to EFAULT ("Bad address"). Under djgpp, however, it sends a
SIGSEGV. Is this correct? What does POSIX / ANSI have to say?

Nate Eldredge
eldredge AT ap DOT net



- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019