summaryrefslogtreecommitdiff
path: root/lib/spawnattr_getdefault.c
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2008-09-28 14:05:12 +0200
committerBruno Haible <bruno@clisp.org>2008-09-28 14:05:12 +0200
commit2903a5c69182cb693db9afb9c64ad14c586a43cc (patch)
tree931cec4398492a134accbe227873c2d3fb65f6dd /lib/spawnattr_getdefault.c
parent2c984d42b8b4b1c5d48a61fd1f01f4e8d9f42172 (diff)
downloadgnulib-2903a5c69182cb693db9afb9c64ad14c586a43cc.tar.gz
New module 'posix_spawnattr_getsigdefault'.
Diffstat (limited to 'lib/spawnattr_getdefault.c')
-rw-r--r--lib/spawnattr_getdefault.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/lib/spawnattr_getdefault.c b/lib/spawnattr_getdefault.c
new file mode 100644
index 0000000000..53f7d530f9
--- /dev/null
+++ b/lib/spawnattr_getdefault.c
@@ -0,0 +1,34 @@
+/* Copyright (C) 2000 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include <spawn.h>
+
+#include <string.h>
+
+/* Store signal mask for signals with default handling from ATTR in
+ SIGDEFAULT. */
+int
+posix_spawnattr_getsigdefault (const posix_spawnattr_t *attr,
+ sigset_t *sigdefault)
+{
+ /* Copy the sigset_t data to the user buffer. */
+ memcpy (sigdefault, &attr->_sd, sizeof (sigset_t));
+
+ return 0;
+}