Re: PATCH: Make gdbserver use async I/O on Linux

Eli Zaretskii
2001-06-06T23:34:00Z

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.