Octave-Forge - Extra packages for GNU Octave | |
Home · Packages · Developers · Documentation · FAQ · Bugs · Mailing Lists · Links · Code |
00001 /* -*- buffer-read-only: t -*- vi: set ro: */ 00002 /* DO NOT EDIT! GENERATED AUTOMATICALLY! */ 00003 /* closexec.c - set or clear the close-on-exec descriptor flag 00004 00005 Copyright (C) 2004, 2009-2011 Free Software Foundation, Inc. 00006 00007 This program is free software: you can redistribute it and/or modify 00008 it under the terms of the GNU General Public License as published by 00009 the Free Software Foundation; either version 3 of the License, or 00010 (at your option) any later version. 00011 00012 This program is distributed in the hope that it will be useful, 00013 but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 GNU General Public License for more details. 00016 00017 You should have received a copy of the GNU General Public License 00018 along with this program. If not, see <http://www.gnu.org/licenses/>. 00019 00020 */ 00021 00022 #include <stdbool.h> 00023 00024 /* Set the `FD_CLOEXEC' flag of DESC if VALUE is true, 00025 or clear the flag if VALUE is false. 00026 Return 0 on success, or -1 on error with `errno' set. 00027 00028 Note that on MingW, this function does NOT protect DESC from being 00029 inherited into spawned children. Instead, either use dup_cloexec 00030 followed by closing the original DESC, or use interfaces such as 00031 open or pipe2 that accept flags like O_CLOEXEC to create DESC 00032 non-inheritable in the first place. */ 00033 00034 int set_cloexec_flag (int desc, bool value); 00035 00036 /* Duplicates a file handle FD, while marking the copy to be closed 00037 prior to exec or spawn. Returns -1 and sets errno if FD could not 00038 be duplicated. */ 00039 00040 int dup_cloexec (int fd);