Download src/binutils/binutils-2.44/libiberty/filedescriptor.c from meddyrat/dis-bench: direct link, hf CLI and curl.
- Browser
- Download file 1.36 kB
-
https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/binutils/binutils-2.44/libiberty/filedescriptor.c
- Command line
-
hf download hf://datasets/meddyrat/dis-bench/src/binutils/binutils-2.44/libiberty/filedescriptor.c
-
curl -L -o filedescriptor.c https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/binutils/binutils-2.44/libiberty/filedescriptor.c
1.36 kB
| /* File descriptor related functions. | |
| Copyright (C) 2019-2025 Free Software Foundation, Inc. | |
| This file is part of the libiberty 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 2 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, write to the Free Software | |
| Foundation, Inc., 51 Franklin Street - Fifth Floor, | |
| Boston, MA 02110-1301, USA. */ | |
| /* Return true when FD file descriptor exists. */ | |
| int | |
| is_valid_fd (int fd) | |
| { | |
| HANDLE h = (HANDLE) _get_osfhandle (fd); | |
| return h != (HANDLE) -1; | |
| return fcntl (fd, F_GETFD) >= 0; | |
| return dup2 (fd, fd) < 0; | |
| } | |