CnUnix

[알림판목록 I] [알림판목록 II] [글목록][이 전][다 음]
[ CnUnix ] in KIDS
글 쓴 이(By): guest (guest) <211.203.198.171>
날 짜 (Date): 2002년 5월 12일 일요일 오후 06시 18분 42초
제 목(Title): SA_RESTART flag of sigaction call 


Hi.
I'm working on a SunOS 5.7 machine.
In my code, I registered a signal handler for SIGCHLD with SA_RESTART flag
enabled.
And I also make use of accept function. I expected the accept function to be
automatically
restarted when a SIGCHLD signal occurred, but instead it returned -1 with
errno set to EINTR.
I read the man page of the sigaction function and I found this fragment:
SA_RESTART
               If set and the signal is  caught,  functions  that
               are  interrupted by the execution of this signal's
               handler are transparently restarted by the system,
               namely  fcntl(2),  ioctl(2),  wait(2),  waitid(2),
               and the following functions on slow  devices  like
               terminals: getmsg() and getpmsg() (see getmsg(2));
               putmsg() and putpmsg() (see  putmsg(2));  pread(),
               read(),   and  readv()  (see  read(2));  pwrite(),
               write(),  and  writev()  (see  write(2));  recv(),
               recvfrom(),  and  recvmsg()  (see  recv(3N));  and
               send(), sendto(),  and  sendmsg()  (see  recv(3N).
               Otherwise, the function returns an  EINTR error.

So, OK. accept() isn't on the list.
But Posix standard says like this:
SA_RESTART
This flag affects the behavior of interruptible functions; that is, those
specified to fail with errno set to [EINTR]. If set, and a function
specified
as interruptible is interrupted by this signal, the function shall restart
and
shall not fail with [EINTR] unless otherwise specified. If the flag is not
------------------------------------------------
set, interruptible functions interrupted by this signal shall fail with
errno
set to [EINTR].

Please pay attention to the underlined part.
So I also read the part of accept() function and it didn't specify that it
would not
be affected by SA_RESTART flag. Then does this mean that SunOS 5.7 is not
fully
compliant with the latest POSIX standard? Or am I missing something?
Thanks in advance!

[알림판목록 I] [알림판목록 II] [글 목록][이 전][다 음]
키 즈 는 열 린 사 람 들 의 모 임 입 니 다.