Changeset 2917
- Timestamp:
- Dec 28, 2006, 5:06:32 PM (19 years ago)
- Location:
- trunk/libc
- Files:
-
- 1 added
- 1 deleted
- 5 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/libc/include/io.h
r2229 r2917 107 107 int _ftruncate(int, off_t); 108 108 #endif 109 int _imphandle ( int);109 int _imphandle (__uintptr_t); 110 110 int _ioctl (int, unsigned long request, ...); 111 111 int _isatty (int); -
trunk/libc/include/klibc/backend.h
r2916 r2917 161 161 162 162 163 /** @defgroup __libc_Back_fs kLIBC Backend - File Handle 164 * @{ */ 165 166 /** 167 * Imports a standard file/pipe/that-kind-of-thing handle. 168 * 169 * @returns kLIBC file descriptor number on success. 170 * @returns -1 and errno on failure. 171 * 172 * @param hNative The native handle value. 173 * @param fh The requested file handle. -1 if any will do. 174 */ 175 int __libc_Back_fhImport(intptr_t hNative, int fh); 176 177 /** @} */ 178 179 180 163 181 /** @defgroup __libc_Back_fs LIBC Backend - File System 164 182 * @{ */ -
trunk/libc/src/kNIX/Makefile.kmk
r2915 r2917 35 35 libc_kNIX_INCS = $(PATH_LIBC_SRC)/kNIX 36 36 libc_kNIX_SOURCES = \ 37 $(PATH_LIBC_SRC)/kNIX/b_fhImport.c \ 37 38 $(PATH_LIBC_SRC)/kNIX/b_fsPathResolve.c \ 38 39 $(PATH_LIBC_SRC)/kNIX/b_fsSymlinkModeSet.c \ … … 170 171 $(PATH_LIBC_SRC)/kNIX/os2/__dup.c \ 171 172 $(PATH_LIBC_SRC)/kNIX/os2/__dup2.c \ 172 $(PATH_LIBC_SRC)/kNIX/os2/__imphandle.c \173 173 $(PATH_LIBC_SRC)/kNIX/os2/__init.c \ 174 174 $(PATH_LIBC_SRC)/kNIX/os2/__initdll.c \ -
trunk/libc/src/kNIX/kNIX.h
r2916 r2917 234 234 /** @} */ 235 235 236 237 /** @name File Handles 238 * @{ 239 */ 240 int __libc_FHImportFile(uintptr_t hNative, int fh, __LIBC_PFH *ppFH); 241 /** @} */ 242 243 236 244 /** @name ?? 237 245 * @{ -
trunk/libc/src/libc/io/Makefile.kmk
r2906 r2917 149 149 $(PATH_LIBC_SRC)/libc/io/_fsetmod.c \ 150 150 $(PATH_LIBC_SRC)/libc/io/_fsopen.c \ 151 $(PATH_LIBC_SRC)/libc/io/_imphand .c \151 $(PATH_LIBC_SRC)/libc/io/_imphandle.c \ 152 152 $(PATH_LIBC_SRC)/libc/io/_input.c \ 153 153 $(PATH_LIBC_SRC)/libc/io/_isterm.c \ -
trunk/libc/src/libc/io/_imphandle.c
r2899 r2917 1 /* _imphand.c (emx+gcc) -- Copyright (c) 1994-1996 by Eberhard Mattes */ 1 /* $Id: $ */ 2 /** @file 3 * 4 * kNIX - _imphandle(). 5 * 6 * Copyright (c) 2006 knut st. osmundsen <bird-srcspam@anduin.net> 7 * 8 * 9 * This file is part of kLIBC. 10 * 11 * kLIBC is free software; you can redistribute it and/or modify 12 * it under the terms of the GNU Lesser General Public License as published 13 * by the Free Software Foundation; either version 2 of the License, or 14 * (at your option) any later version. 15 * 16 * kLIBC is distributed in the hope that it will be useful, 17 * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 * GNU Lesser General Public License for more details. 20 * 21 * You should have received a copy of the GNU Lesser General Public License 22 * along with kLIBC; if not, write to the Free Software 23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 24 * 25 */ 2 26 3 27 #include "libc-alias.h" 4 28 #include <io.h> 5 #include <emx/syscalls.h> 29 #include <errno.h> 30 #include <klibc/backend.h> 31 #define __LIBC_LOG_GROUP __LIBC_LOG_GRP_IO 32 #include <klibc/logstrict.h> 6 33 7 int _imphandle (int handle) 34 /** 35 * Imports a standard file/pipe/that-kind-of-thing handle. 36 * 37 * @returns kLIBC file descriptor number on success. 38 * @returns -1 and errno on failure. 39 * 40 * @param hHandle The handle value. 41 */ 42 int _imphandle(__uintptr_t hHandle) 8 43 { 9 return __imphandle(handle); 44 LIBCLOG_ENTER("hHandle=%td (%#tx)\n", hHandle, hHandle); 45 int rc = __libc_Back_fhImport(hHandle, -1); 46 if (rc >= 0) 47 LIBCLOG_RETURN_INT(rc); 48 errno = -rc; 49 LIBCLOG_ERROR_RETURN_INT(-1); 10 50 } 51
Note:
See TracChangeset
for help on using the changeset viewer.