BSD #define (MSG_NOSIGNAL) vs. Apple #define (MSG_HAVEMORE)
BSD #define (MSG_NOSIGNAL) vs. Apple #define (MSG_HAVEMORE)
- Subject: BSD #define (MSG_NOSIGNAL) vs. Apple #define (MSG_HAVEMORE)
- From: Jens Bauer <email@hidden>
- Date: Thu, 19 Dec 2002 23:23:35 +0100
Hi all,
I'm porting some code, and ran across this problem.
In <sys/socket.h> I see the following:
...
#define MSG_EOF 0x100 /* data completes connection */
#ifdef __APPLE__
#define MSG_FLUSH 0x400 /* Start of 'hold' seq; dump
so_temp */
#define MSG_HOLD 0x800 /* Hold frag in so_temp */
#define MSG_SEND 0x1000 /* Send the packet in so_temp */
#define MSG_HAVEMORE 0x2000 /* Data ready to be read */
#define MSG_RCVMORE 0x4000 /* Data remains in current pkt
*/
#endif
#define MSG_COMPAT 0x8000 /* used in sendit() */
...
Now, the manpage for send says this:
#define MSG_OOB 0x1 /* process out-of-band data */
#define MSG_DONTROUTE 0x4 /* bypass routing, use direct
interface */
#define MSG_DONTWAIT 0x40 /* don't block */
#define MSG_NOSIGNAL 0x2000 /* don't raise SIGPIPE */
MSG_OOB
Sends out-of-band data on sockets that support this notion (e.g.
SOCK_STREAM); the underlying protocol must also support out-of-band
data.
MSG_DONTROUTE
Bypasses the usual routing table lookup and sends the packet directly
to the interface described by the destination address. This is usually
used only by diagnostic or routing programs.
MSG_DONTWAIT
Enables non-blocking operation; if the operation would block, EAGAIN is
returned.
MSG_NOSIGNAL
Requests not to send SIGPIPE on errors on stream oriented sockets when
the other end breaks the
connection. The EPIPE error is still returned.
MSG_NOSIGNAL clashes with Apple's MSG_HAVEMORE
(notice: MSG_DONTWAIT is 0x80 in my socket.h, but it seems it's 0x40 in
the Linux socket.h)
-I can't make up my own MSG_NOSIGNAL, so what should I do to the
following line...
return(-1 != ::send(m_Sock, s.c_str(), s.size(), MSG_NOSIGNAL));
?
Love,
Jens
_______________________________________________
macnetworkprog mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/macnetworkprog
Do not post admin requests to the list. They will be ignored.