From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eli Zaretskii To: Daniel Jacobowitz Cc: gdb-patches@sources.redhat.com Subject: Re: PATCH: Make gdbserver use async I/O on Linux Date: Wed, 06 Jun 2001 23:34:00 -0000 Message-id: References: <20010606140322.A29266@nevyn.them.org> X-SW-Source: 2001-06/msg00114.html On Wed, 6 Jun 2001, Daniel Jacobowitz wrote: > The only problem I can think of that this might cause is if F_SETOWN is less > portable than FASYNC. Exactly. And that is why I'd suggest to make this change conditioned on F_SETOWN being defined. Please note that the original code took care to use the F* macros only if they were defined: > #if defined(F_SETFL) && defined (FASYNC) > save_fcntl_flags = fcntl (remote_desc, F_GETFL, 0); > fcntl (remote_desc, F_SETFL, save_fcntl_flags | FASYNC); > + fcntl (remote_desc, F_SETOWN, getpid()); > disable_async_io (); > #endif /* FASYNC */ This uses F_SETFL and FASYNC only if they are defined. I suggest to do the same with F_SETOWN.