Mercurial > hg > octave-jordi > gnulib-hg
annotate lib/spawnattr_setpgroup.c @ 18029:e4a13d95b503
mgetgroups: port to strict OS X
* doc/glibc-functions/getgrouplist.texi (getgrouplist):
Document the getgrouplist problem.
* lib/mgetgroups.c (getgrouplist_gids) [HAVE_GETGROUPLIST]:
New macro.
(mgetgroups): Use it.
* m4/mgetgroups.m4 (gl_MGETGROUPS):
Check for OS X signature for getgrouplist.
author | Paul Eggert <eggert@cs.ucla.edu> |
---|---|
date | Sun, 28 Jun 2015 23:43:35 -0700 |
parents | ab58d4870664 |
children |
rev | line source |
---|---|
17848 | 1 /* Copyright (C) 2000, 2009-2015 Free Software Foundation, Inc. |
10515
f3bb31f57bb2
New module 'posix_spawnattr_setpgroup'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
2 This file is part of the GNU C Library. |
f3bb31f57bb2
New module 'posix_spawnattr_setpgroup'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
3 |
f3bb31f57bb2
New module 'posix_spawnattr_setpgroup'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4 This program is free software: you can redistribute it and/or modify |
f3bb31f57bb2
New module 'posix_spawnattr_setpgroup'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5 it under the terms of the GNU General Public License as published by |
f3bb31f57bb2
New module 'posix_spawnattr_setpgroup'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6 the Free Software Foundation; either version 3 of the License, or |
f3bb31f57bb2
New module 'posix_spawnattr_setpgroup'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
7 (at your option) any later version. |
f3bb31f57bb2
New module 'posix_spawnattr_setpgroup'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
8 |
f3bb31f57bb2
New module 'posix_spawnattr_setpgroup'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
9 This program is distributed in the hope that it will be useful, |
f3bb31f57bb2
New module 'posix_spawnattr_setpgroup'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
10 but WITHOUT ANY WARRANTY; without even the implied warranty of |
f3bb31f57bb2
New module 'posix_spawnattr_setpgroup'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
f3bb31f57bb2
New module 'posix_spawnattr_setpgroup'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
12 GNU General Public License for more details. |
f3bb31f57bb2
New module 'posix_spawnattr_setpgroup'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
13 |
f3bb31f57bb2
New module 'posix_spawnattr_setpgroup'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
14 You should have received a copy of the GNU General Public License |
f3bb31f57bb2
New module 'posix_spawnattr_setpgroup'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
15 along with this program. If not, see <http://www.gnu.org/licenses/>. */ |
f3bb31f57bb2
New module 'posix_spawnattr_setpgroup'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
16 |
f3bb31f57bb2
New module 'posix_spawnattr_setpgroup'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
17 #include <config.h> |
f3bb31f57bb2
New module 'posix_spawnattr_setpgroup'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
18 |
f3bb31f57bb2
New module 'posix_spawnattr_setpgroup'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
19 /* Specification. */ |
f3bb31f57bb2
New module 'posix_spawnattr_setpgroup'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
20 #include <spawn.h> |
f3bb31f57bb2
New module 'posix_spawnattr_setpgroup'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
21 |
f3bb31f57bb2
New module 'posix_spawnattr_setpgroup'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
22 #include <string.h> |
f3bb31f57bb2
New module 'posix_spawnattr_setpgroup'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
23 |
f3bb31f57bb2
New module 'posix_spawnattr_setpgroup'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
24 /* Store process group ID in the attribute structure. */ |
f3bb31f57bb2
New module 'posix_spawnattr_setpgroup'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
25 int |
f3bb31f57bb2
New module 'posix_spawnattr_setpgroup'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
26 posix_spawnattr_setpgroup (posix_spawnattr_t *attr, pid_t pgroup) |
f3bb31f57bb2
New module 'posix_spawnattr_setpgroup'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
27 { |
f3bb31f57bb2
New module 'posix_spawnattr_setpgroup'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
28 /* Store the process group ID. */ |
f3bb31f57bb2
New module 'posix_spawnattr_setpgroup'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
29 attr->_pgrp = pgroup; |
f3bb31f57bb2
New module 'posix_spawnattr_setpgroup'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
30 |
f3bb31f57bb2
New module 'posix_spawnattr_setpgroup'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
31 return 0; |
f3bb31f57bb2
New module 'posix_spawnattr_setpgroup'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
32 } |