mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
posix_spawnattr_setflags(3): validate argument
(cherry picked from commit 80ac36c3a2a87a19790eba487466bf70d55f566e)
This commit is contained in:
parent
965f92a282
commit
eb36277dc9
2 changed files with 9 additions and 2 deletions
|
|
@ -629,6 +629,10 @@ posix_spawnattr_getsigmask(const posix_spawnattr_t * __restrict sa,
|
|||
int
|
||||
posix_spawnattr_setflags(posix_spawnattr_t *sa, short flags)
|
||||
{
|
||||
if ((flags & ~(POSIX_SPAWN_RESETIDS | POSIX_SPAWN_SETPGROUP |
|
||||
POSIX_SPAWN_SETSCHEDPARAM | POSIX_SPAWN_SETSCHEDULER |
|
||||
POSIX_SPAWN_SETSIGDEF | POSIX_SPAWN_SETSIGMASK)) != 0)
|
||||
return (EINVAL);
|
||||
(*sa)->sa_flags = flags;
|
||||
return (0);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -83,9 +83,12 @@ The default value of this attribute is as if no flags were set.
|
|||
.Sh RETURN VALUES
|
||||
The
|
||||
.Fn posix_spawnattr_getflags
|
||||
and
|
||||
function returns zero.
|
||||
The
|
||||
.Fn posix_spawnattr_setflags
|
||||
functions return zero.
|
||||
function returns zero on success, and
|
||||
.Er EINVAL
|
||||
on failure due to invalid flag specified.
|
||||
.Sh SEE ALSO
|
||||
.Xr posix_spawn 3 ,
|
||||
.Xr posix_spawnattr_destroy 3 ,
|
||||
|
|
|
|||
Loading…
Reference in a new issue