This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH][BZ 21340] add support for POSIX_SPAWN_SETSID



On 03/04/2017 16:12, Florian Weimer wrote:
> On 04/01/2017 04:29 PM, daurnimator wrote:
>> diff --git a/posix/spawn.h b/posix/spawn.h
>> index 36e3867e17..8d2ace1b87 100644
>> --- a/posix/spawn.h
>> +++ b/posix/spawn.h
>> @@ -60,6 +60,7 @@ typedef struct
>>  #ifdef __USE_GNU
>>  # define POSIX_SPAWN_USEVFORK        0x40
>>  #endif
>> +#define POSIX_SPAWN_SETSID        0x80
>>
> 
> Doesn't this add the flag to past POSIX versions?

I do not think this is an issue since afaik POSIX does not state any 
constraint regarding the flags values [1].  For instance, the example
library implementation uses spawn as example and just use constant
different than glibc [2].

In fact I wish we had never added this constant functionality and 
now that it is a no-op on Linux we can start to think about signalling
it is deprecated.  One option would just remove it from default
posix implementation (and just use fork) and stop to exporting it.
New flags will still need to use 0x80 unfortunately. 

> 
> I'd prefer if there was a test case for the new functionality, perhaps using the getsid function.

It seems a good idea indeed.

> 
> I wonder if we should add a new symbol version for posix_spawnattr_setflags, so that applications which do not perform error checking for the function call fail in a predictable manner.
> 

I do not follow, which semantic difference are you proposing for
posix_spawnattr_setflags that are not covered currently?

> Thanks,
> Florian

[1] http://pubs.opengroup.org/onlinepubs/9699919799/
[2] http://pubs.opengroup.org/onlinepubs/9699919799/xrat/V4_xsh_chap03.html


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]