Changeset 3687
- Timestamp:
- Mar 15, 2011, 11:57:10 PM (14 years ago)
- Location:
- trunk/libc/src
- Files:
-
- 4 added
- 1 deleted
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/libc/src/kNIX/Makefile.kmk
r3683 r3687 49 49 $(PATH_LIBC_SRC)/kNIX/b_fsFileStat.c \ 50 50 $(PATH_LIBC_SRC)/kNIX/b_fsFileStatFH.c \ 51 $(PATH_LIBC_SRC)/kNIX/b_fsInfoPathConf.c \ 52 $(PATH_LIBC_SRC)/kNIX/b_fsPathConf.c \ 51 53 $(PATH_LIBC_SRC)/kNIX/b_fsSymlinkRead.c \ 52 54 $(PATH_LIBC_SRC)/kNIX/b_fsSymlinkStat.c \ … … 60 62 $(PATH_LIBC_SRC)/kNIX/b_ioFileSizeSet.c \ 61 63 $(PATH_LIBC_SRC)/kNIX/b_ioFHToPath.c \ 64 $(PATH_LIBC_SRC)/kNIX/b_ioPathConf.c \ 62 65 $(PATH_LIBC_SRC)/kNIX/b_ioRead.c \ 63 66 $(PATH_LIBC_SRC)/kNIX/b_ioSeek.c \ -
trunk/libc/src/kNIX/kNIX.h
r3683 r3687 238 238 __LIBC_PFSINFO __libc_back_fsInfoObjAddRef(__LIBC_PFSINFO pFsInfo); 239 239 void __libc_back_fsInfoObjRelease(__LIBC_PFSINFO pFsInfo); 240 int __libc_back_fsInfoPathConf(__LIBC_PFSINFO pFsInfo, int iName, long *plValue); 240 241 241 242 uint32_t __libc_back_djb2(const char *psz); -
trunk/libc/src/kNIX/os2/fs-os2.c
r3630 r3687 281 281 * Setup the the executable path rewrite rule. 282 282 */ 283 PTIB pTib; 283 PTIB pTib; 284 284 PPIB pPib; 285 285 DosGetInfoBlocks(&pTib, &pPib); 286 286 APIRET rc = DosQueryModuleName(pPib->pib_hmte, sizeof(__libc_gszExecPath), &__libc_gszExecPath[0]); 287 if (!rc) 287 if (!rc) 288 288 { 289 289 char *psz = strchr(&__libc_gszExecPath[0], '\0'); 290 while ( psz > &__libc_gszExecPath[0] 290 while ( psz > &__libc_gszExecPath[0] 291 291 && *psz != '\\' 292 292 && *psz != '/' … … 309 309 if (DosQuerySysInfo(QSV_BOOT_DRIVE, QSV_BOOT_DRIVE, &ulBootDrive, sizeof(ulBootDrive))) 310 310 ulBootDrive = 'C' - 'A' - 1; /* A = 1 */ 311 __libc_gszTmpDir[0] = __libc_gszSystemRoot[0] = __libc_gszSystemDrive[0] 311 __libc_gszTmpDir[0] = __libc_gszSystemRoot[0] = __libc_gszSystemDrive[0] 312 312 = (char)ulBootDrive + 'A' - 1; 313 313 … … 463 463 { 464 464 static char achBuffer[384]; /* we're protected by the mutex, don't assume too much stack! */ 465 ULONG cb = sizeof(achBuffer);465 ULONG cb = sizeof(achBuffer); 466 466 PFSQBUFFER2 pfsqb = (PFSQBUFFER2)achBuffer; 467 467 468 /* init the structure */ 469 pFsInfo->fZeroNewBytes = 0; 470 pFsInfo->fUnixEAs = 0; 471 pFsInfo->Dev = Dev; 472 pFsInfo->szName[0] = '\0'; 473 pFsInfo->szMountpoint[0] = minor(Dev); 474 pFsInfo->szMountpoint[1] = ':'; 475 pFsInfo->szMountpoint[2] = '\0'; 476 pFsInfo->szMountpoint[3] = '\0'; 468 /* init the structure with defaults. */ 469 pFsInfo->fZeroNewBytes = 0; 470 pFsInfo->fUnixEAs = 0; 471 pFsInfo->fChOwnRestricted = 1; 472 pFsInfo->fNoNameTrunc = 1; 473 pFsInfo->cFileSizeBits = 64; 474 pFsInfo->cchMaxPath = CCHMAXPATH; 475 pFsInfo->cchMaxName = CCHMAXPATHCOMP; 476 pFsInfo->cchMaxSymlink = CCHMAXPATH; 477 pFsInfo->cMaxLinks = 1; 478 pFsInfo->cchMaxTermCanon = MAX_CANON; 479 pFsInfo->cchMaxTermInput = MAX_INPUT; 480 pFsInfo->cbPipeBuf = _POSIX_PIPE_BUF; 481 pFsInfo->cbBlock = 512; 482 pFsInfo->cbXferIncr = 0x1000; 483 pFsInfo->cbXferMax = 0xf000; 484 pFsInfo->cbXferMin = 0x1000; 485 pFsInfo->uXferAlign = 0x1000; 486 pFsInfo->Dev = Dev; 487 pFsInfo->szName[0] = '\0'; 488 pFsInfo->szMountpoint[0] = minor(Dev); 489 pFsInfo->szMountpoint[1] = ':'; 490 pFsInfo->szMountpoint[2] = '\0'; 491 pFsInfo->szMountpoint[3] = '\0'; 477 492 478 493 /* query fs info */ … … 482 497 if (!rc) 483 498 strncat(pFsInfo->szName, (const char *)&pfsqb->szName[pfsqb->cbName + 1], sizeof(pFsInfo->szName) - 1); 484 if ( !strcmp(pFsInfo->szName, "JFS") 485 || !strcmp(pFsInfo->szName, "HPFS") 486 || !strcmp(pFsInfo->szName, "FAT")) 499 if (!strcmp(pFsInfo->szName, "HPFS")) 487 500 { 488 501 pFsInfo->fZeroNewBytes = 1; 489 502 pFsInfo->fUnixEAs = 1; 503 /** @todo detect HPFS386? */ 504 } 505 else if (!strcmp(pFsInfo->szName, "JFS")) 506 { 507 pFsInfo->fZeroNewBytes = 1; 508 pFsInfo->fUnixEAs = 1; 509 } 510 else if (!strcmp(pFsInfo->szName, "FAT")) 511 { 512 pFsInfo->fZeroNewBytes = 1; 513 pFsInfo->fUnixEAs = 1; 514 pFsInfo->cchMaxName = 8+1+3; 490 515 } 491 516 else if (!strcmp(pFsInfo->szName, "LAN")) … … 493 518 /* should find a way of getting the remote fs... */ 494 519 pFsInfo->fZeroNewBytes = 1; /* for performance reasons, assume it zeros. */ 495 pFsInfo->fUnixEAs = 0; 520 pFsInfo->cbXferMin = 0x200; 521 pFsInfo->cbXferIncr = 0x200; 496 522 } 497 523 else if (!strcmp(pFsInfo->szName, "RAMFS")) 498 {499 524 pFsInfo->fZeroNewBytes = 0; 500 pFsInfo->fUnixEAs = 1; /* but it doesn't zero */501 }502 525 /*else if (!strcmp(pFsInfo->szName, "FAT32")) 503 { 504 pFsInfo->fZeroNewBytes = 0; 505 pFsInfo->fUnixEAs = 0; 506 }*/ 507 else 508 { 509 pFsInfo->fZeroNewBytes = 0; 510 pFsInfo->fUnixEAs = 0; 511 } 526 { } */ 512 527 513 528 LIBCLOG_MSG2("fsInfoObjUpdate: dev:%#x mp:%s fsd:%s fZeroNewBytes=%d fUnixEAs=%d\n", … … 699 714 * 700 715 * @returns 0 on success. 701 * @returns Negative error code (errno.h) on fail iure.716 * @returns Negative error code (errno.h) on failure. 702 717 * @param pszUserPath The user path. 703 718 * @parm fFlags Flags controlling the operation of the function. … … 728 743 * 729 744 * @returns 0 on success. 730 * @returns Negative error code (errno.h) on fail iure.745 * @returns Negative error code (errno.h) on failure. 731 746 * @param pszUserPath The user path. 732 747 * @parm fFlags Flags controlling the operation of the function. -
trunk/libc/src/libc/misc/Makefile.kmk
r2935 r3687 67 67 $(PATH_LIBC_SRC)/libc/misc/fnmatch.c \ 68 68 $(PATH_LIBC_SRC)/libc/misc/fnslashi.c \ 69 $(PATH_LIBC_SRC)/libc/misc/fpathcon .c \69 $(PATH_LIBC_SRC)/libc/misc/fpathconf.c \ 70 70 $(PATH_LIBC_SRC)/libc/misc/fstatfs.c \ 71 71 $(PATH_LIBC_SRC)/libc/misc/fullpath.c \ -
trunk/libc/src/libc/misc/pathconf.c
r151 r3687 1 /* pathconf.c (emx+gcc) -- Copyright (c) 1994-1995 by Eberhard Mattes */ 1 /* $Id: $ */ 2 /** @file 3 * 4 * LIBC - pathconf(). 5 * 6 * Copyright (c) 2011 knut st. osmundsen <bird@innotek.de> 7 * 8 * 9 * This file is part of InnoTek LIBC. 10 * 11 * InnoTek LIBC 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 * InnoTek LIBC 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 InnoTek LIBC; if not, write to the Free Software 23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 24 * 25 */ 2 26 27 28 /******************************************************************************* 29 * Header Files * 30 *******************************************************************************/ 3 31 #include "libc-alias.h" 32 #include <errno.h> 4 33 #include <unistd.h> 5 #include <limits.h> 6 #include <errno.h> 34 #include <InnoTekLIBC/backend.h> 35 #define __LIBC_LOG_GROUP __LIBC_LOG_GRP_BACK_FS 36 #include <InnoTekLIBC/logstrict.h> 7 37 8 /* Return the POSIX.1 minimum values, for now. */9 38 10 long _STD(pathconf) (const char *path, int name)39 long _STD(pathconf)(const char *pszPath, int iName) 11 40 { 12 switch (name) 13 { 14 case _PC_LINK_MAX: 15 return _POSIX_LINK_MAX; 41 LIBCLOG_ENTER("pszPath=%p:{%s} iName=%d\n", pszPath, pszPath, iName); 42 long lValue; 43 int rc = __libc_Back_fsPathConf(pszPath, iName, &lValue); 44 if (!rc) 45 LIBCLOG_RETURN_LONG(lValue); 46 errno = -rc; 47 LIBCLOG_ERROR_RETURN_LONG(-1L); 48 } 16 49 17 case _PC_MAX_CANON:18 return _POSIX_MAX_CANON;19 20 case _PC_MAX_INPUT:21 return _POSIX_MAX_INPUT;22 23 case _PC_NAME_MAX:24 return _POSIX_NAME_MAX;25 26 case _PC_PATH_MAX:27 return _POSIX_PATH_MAX;28 29 case _PC_PIPE_BUF:30 return _POSIX_PIPE_BUF;31 32 case _PC_CHOWN_RESTRICTED:33 return 1;34 35 case _PC_NO_TRUNC:36 return 1; /* TODO */37 38 case _PC_VDISABLE:39 return 0;40 41 default:42 errno = EINVAL;43 return -1;44 }45 }
Note:
See TracChangeset
for help on using the changeset viewer.