Changeset 2741
- Timestamp:
- Jul 23, 2006, 7:54:53 AM (19 years ago)
- Location:
- trunk/libc
- Files:
-
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/libc/Config.kmk
r2739 r2741 49 49 DEFS = \ 50 50 IN_INNOTEK_LIBC \ 51 __IN_INNOTEK_LIBC__ 51 __IN_INNOTEK_LIBC__ \ 52 __IN_KLIBC__ 53 52 54 DEFS.os2 = __OS2__ 53 55 DEFS.nt = __NT__ -
trunk/libc/src/fbsdlibc/Makefile.kmk
r2739 r2741 35 35 include $(wildcard $(PATH_LIBC_SRC)/fbsdlibc/*/Makefile.kmk) 36 36 else 37 include $(PATH_LIBC_SRC)/fbsdlibc/gen/Makefile.kmk 37 38 include $(PATH_LIBC_SRC)/fbsdlibc/locale/Makefile.kmk 38 39 endif -
trunk/libc/src/fbsdlibc/gen/arc4random.c
r2029 r2741 33 33 #include <fcntl.h> 34 34 #include <unistd.h> 35 #ifdef __ EMX__35 #ifdef __IN_KLIBC__ 36 36 #include <sys/fmutex.h> 37 37 #else … … 48 48 }; 49 49 50 #ifdef __ EMX__50 #ifdef __IN_KLIBC__ 51 51 static _fmutex arc4random_mtx = _FMUTEX_INITIALIZER; 52 52 #else … … 55 55 56 56 #define RANDOMDEV "/dev/urandom" 57 #ifdef __ EMX__57 #ifdef __IN_KLIBC__ 58 58 #define THREAD_LOCK() _fmutex_request(&arc4random_mtx, 0) 59 59 #define THREAD_UNLOCK() _fmutex_release(&arc4random_mtx) 60 #else /* !__ EMX__ */60 #else /* !__IN_KLIBC__ */ 61 61 #define THREAD_LOCK() \ 62 62 do { \ -
trunk/libc/src/fbsdlibc/gen/fts.c
r2672 r2741 39 39 #endif /* LIBC_SCCS and not lint */ 40 40 #endif 41 #ifndef __ EMX__41 #ifndef __IN_KLIBC__ 42 42 # define HAVE_FCHDIR 43 43 # define HAVE_DIRFD … … 47 47 # define HAVE_FCHDIR 48 48 # undef HAVE_DIRFD 49 # define IS_SLASH(ch) ( (ch) == '/' || (ch) == '\\' ) 49 # if defined(__OS2__) || defined(__NT__) || defined(__WIN__) 50 # define IS_SLASH(ch) ( (ch) == '/' || (ch) == '\\' ) 51 # else 52 # define IS_SLASH(ch) ( (ch) == '/' ) 53 # endif 50 54 #endif 51 55 … … 108 112 }; 109 113 110 #ifndef __ EMX__114 #ifndef __IN_KLIBC__ 111 115 /* 112 116 * The "FTS_NOSTAT" option can avoid a lot of calls to stat(2) if it … … 125 129 0 126 130 }; 127 #endif /* !__ EMX__ */131 #endif /* !__IN_KLIBC__ */ 128 132 129 133 FTS * … … 727 731 * If being called from fts_read, set the fts_info field. 728 732 */ 729 #if defined(FTS_WHITEOUT) && !defined(__ EMX__)733 #if defined(FTS_WHITEOUT) && !defined(__IN_KLIBC__) 730 734 if (ISSET(FTS_WHITEOUT)) 731 735 oflag = DTF_NODUP | DTF_REWIND; … … 1304 1308 1305 1309 priv = (struct _fts_private *)sp; 1306 #ifdef __ EMX__1310 #ifdef __IN_KLIBC__ 1307 1311 /* we don't have reliable links */ 1308 1312 priv->ftsp_linksreliable = 0; -
trunk/libc/src/fbsdlibc/gen/getgrent.c
r2256 r2741 48 48 #include <grp.h> 49 49 #include <nsswitch.h> 50 #ifndef __ EMX__50 #ifndef __IN_KLIBC__ 51 51 #include <pthread.h> 52 52 #include <pthread_np.h> … … 146 146 147 147 /* XXX IEEE Std 1003.1, 2003 specifies `void setgrent(void)' */ 148 int 148 int 149 149 setgrent(void) 150 150 { … … 484 484 } 485 485 rv = NS_NOTFOUND; 486 #ifndef __ EMX__486 #ifndef __IN_KLIBC__ 487 487 while ((line = fgetln(st->fp, &linesize)) != NULL) { 488 488 #else … … 698 698 enum nss_lookup_type how; 699 699 int *errnop, keylen, resultlen, rv; 700 700 701 701 name = NULL; 702 702 gid = (gid_t)-1; … … 801 801 if (rv == NS_SUCCESS && retval != NULL) 802 802 *(struct group **)retval = grp; 803 return (rv); 803 return (rv); 804 804 erange: 805 805 *errnop = ERANGE; … … 1019 1019 } 1020 1020 rv = NS_NOTFOUND; 1021 #ifndef __ EMX__1021 #ifndef __IN_KLIBC__ 1022 1022 while ((line = fgetln(st->fp, &linesize)) != NULL) { 1023 1023 #else … … 1035 1035 st->name = malloc(p - line); 1036 1036 if (st->name == NULL) { 1037 #ifndef __ EMX__1037 #ifndef __IN_KLIBC__ 1038 1038 syslog(LOG_ERR, 1039 1039 "getgrent memory allocation failure"); -
trunk/libc/src/fbsdlibc/gen/getmntinfo.c
r1694 r2741 40 40 41 41 #include <sys/param.h> 42 #ifndef __ EMX__42 #ifndef __IN_KLIBC__ 43 43 #include <sys/ucred.h> 44 44 #endif -
trunk/libc/src/fbsdlibc/gen/getnetgrent.c
r1697 r2741 341 341 #endif 342 342 /* Sanity check */ 343 343 344 344 if (group == NULL || !strlen(group)) 345 345 return (0); -
trunk/libc/src/fbsdlibc/gen/getprogname.c
r927 r2741 9 9 10 10 #ifdef __EMX__ 11 #define INCL_BASE 12 #define INCL_FSMACROS 13 #include <os2emx.h> 14 #include <string.h> 11 # define INCL_BASE 12 # define INCL_FSMACROS 13 # include <os2emx.h> 14 # include <string.h> 15 const char *__progname = NULL; 16 #endif 17 #ifdef __NT__ 18 # include <klibc/nt/nt.h> 15 19 const char *__progname = NULL; 16 20 #endif … … 22 26 _getprogname(void) 23 27 { 24 #ifdef __EMX__25 28 /* 26 29 * On demand initiation. … … 31 34 if (!__progname) 32 35 { 36 #ifdef __EMX__ 33 37 char *psz, *psz2; 34 38 PTIB ptib; … … 51 55 /* This is in the volatile env. block - dupe it. */ 52 56 __progname = strdup(psz2); 57 58 #elif defined(__NT__) 59 asm("int3\n"); 60 #else 61 # error "Port me!" 62 #endif 53 63 } 54 #endif 55 return (__progname); 64 return (__progname); 56 65 } 66 -
trunk/libc/src/fbsdlibc/gen/getpwent.c
r2256 r2741 49 49 #include <netdb.h> 50 50 #include <nsswitch.h> 51 #ifndef __ EMX__51 #ifndef __IN_KLIBC__ 52 52 #include <pthread.h> 53 53 #include <pthread_np.h> … … 475 475 if (*version < 3 || 476 476 *version >= sizeof(pwdb_versions)/sizeof(pwdb_versions[0])) { 477 #ifndef __ EMX__477 #ifndef __IN_KLIBC__ 478 478 syslog(LOG_CRIT, "Unsupported password database version %d", 479 479 *version); … … 1195 1195 return (0); 1196 1196 enomem: 1197 #ifndef __ EMX__1197 #ifndef __IN_KLIBC__ 1198 1198 syslog(LOG_ERR, "getpwent memory allocation failure"); 1199 1199 #endif … … 1224 1224 copy = malloc(n); 1225 1225 if (copy == NULL) { 1226 #ifndef __ EMX__1226 #ifndef __IN_KLIBC__ 1227 1227 syslog(LOG_ERR, "getpwent memory allocation failure"); 1228 1228 #endif … … 1605 1605 st->name = strdup(&pw_name[1]); 1606 1606 if (st->name == NULL) { 1607 #ifndef __ EMX__1607 #ifndef __IN_KLIBC__ 1608 1608 syslog(LOG_ERR, 1609 1609 "getpwent memory allocation failure"); -
trunk/libc/src/fbsdlibc/gen/glob.c
r1697 r2741 159 159 static int glob3(Char *, Char *, Char *, Char *, Char *, glob_t *, int *); 160 160 static int globextend(const Char *, glob_t *, int *); 161 static const Char * 161 static const Char * 162 162 globtilde(const Char *, Char *, size_t, glob_t *); 163 163 static int globexp1(const Char *, glob_t *, int *); … … 808 808 while (((c = *pat++) & M_MASK) != M_END) 809 809 if ((*pat & M_MASK) == M_RNG) { 810 #ifdef __ EMX__ /* we don't include all the locale stuff, only standalone stuff like this. */810 #ifdef __IN_KLIBC__ /* we don't include all the locale stuff, only standalone stuff like this. */ 811 811 if ( __collate_range_cmp(CHAR(c), CHAR(k)) <= 0 812 812 && __collate_range_cmp(CHAR(k), CHAR(pat[1])) <= 0) -
trunk/libc/src/fbsdlibc/gen/isinf.c
r2139 r2741 45 45 46 46 u.d = d; 47 #ifdef __ EMX__47 #ifdef __IN_KLIBC__ 48 48 return (u.bits.exp == 2047 && u.bits.manl == 0 && u.bits.manh == 0) 49 49 ? u.bits.sign ? -1 : 1 : 0; … … 59 59 60 60 u.f = f; 61 #ifdef __ EMX__61 #ifdef __IN_KLIBC__ 62 62 return (u.bits.exp == 255 && u.bits.man == 0) 63 63 ? u.bits.sign ? -1 : 1 : 0; … … 74 74 u.e = e; 75 75 mask_nbit_l(u); 76 #ifdef __ EMX__76 #ifdef __IN_KLIBC__ 77 77 #ifndef __alpha__ 78 78 return (u.bits.exp == 32767 && u.bits.manl == 0 && u.bits.manh == 0) … … 89 89 #endif 90 90 } 91 -
trunk/libc/src/fbsdlibc/gen/setprogname.c
r1694 r2741 12 12 { 13 13 const char *p; 14 #if def __EMX__14 #if defined(__EMX__) || defined(__NT__) 15 15 p = strlen(progname) + progname; 16 16 while (p >= progname) -
trunk/libc/src/fbsdlibc/locale/mblocal.h
r1705 r2741 35 35 * Conversion function pointers for current encoding. 36 36 */ 37 #ifndef __IN NOTEK_LIBC__37 #ifndef __IN_KLIBC__ 38 38 extern size_t (*__mbrtowc)(wchar_t * __restrict, const char * __restrict, 39 39 size_t, mbstate_t * __restrict); … … 44 44 extern size_t (*__wcsnrtombs)(char * __restrict, const wchar_t ** __restrict, 45 45 size_t, size_t, mbstate_t * __restrict); 46 #else /* !__IN NOTEK_LIBC__ */47 # define __mbrtowc(a,b,c,d) __libc_GLocaleCtype.CtypeFuncs.pfnmbrtowc(a,b,c,d)48 # define __mbsinit(a) __libc_GLocaleCtype.CtypeFuncs.pfnmbsinit(a)49 # define __mbsnrtowcs(a,b,c,d,e) __libc_GLocaleCtype.CtypeFuncs.pfnmbsnrtowcs(a,b,c,d,e)50 # define __wcrtomb(a,b,c) __libc_GLocaleCtype.CtypeFuncs.pfnwcrtomb(a,b,c)51 # define __wcsnrtombs(a,b,c,d,e) __libc_GLocaleCtype.CtypeFuncs.pfnwcsnrtombs(a,b,c,d,e)46 #else /* !__IN_KLIBC__ */ 47 # define __mbrtowc(a,b,c,d) __libc_GLocaleCtype.CtypeFuncs.pfnmbrtowc(a,b,c,d) 48 # define __mbsinit(a) __libc_GLocaleCtype.CtypeFuncs.pfnmbsinit(a) 49 # define __mbsnrtowcs(a,b,c,d,e) __libc_GLocaleCtype.CtypeFuncs.pfnmbsnrtowcs(a,b,c,d,e) 50 # define __wcrtomb(a,b,c) __libc_GLocaleCtype.CtypeFuncs.pfnwcrtomb(a,b,c) 51 # define __wcsnrtombs(a,b,c,d,e) __libc_GLocaleCtype.CtypeFuncs.pfnwcsnrtombs(a,b,c,d,e) 52 52 #endif 53 53 -
trunk/libc/src/fbsdlibc/locale/utf8.c
r2739 r2741 31 31 #include <errno.h> 32 32 #include <limits.h> 33 #ifdef IN_INNOTEK_LIBC34 # include <InnotekLIBC/locale.h>33 #ifdef __IN_KLIBC__ 34 # include <InnotekLIBC/locale.h> 35 35 #else 36 36 #include <runetype.h> … … 56 56 } _UTF8State; 57 57 58 #ifndef IN_INNOTEK_LIBC58 #ifndef __IN_KLIBC__ 59 59 int 60 60 _UTF8_init(_RuneLocale *rl) … … 71 71 return (0); 72 72 } 73 #else 73 #else /* __IN_KLIBC__ */ 74 74 void __libc_localeFuncsUTF8(__LIBC_PLOCALECTYPEFUNCS pFuncs) 75 75 { … … 80 80 pFuncs->pfnwcsnrtombs = _UTF8_wcsnrtombs; 81 81 } 82 #endif /* IN_INNOTEK_LIBC*/82 #endif /* __IN_KLIBC__ */ 83 83 84 84 int -
trunk/libc/src/libc/malloc/Makefile.kmk
r2739 r2741 98 98 $(PATH_LIBC_SRC)/libc/malloc/_um_abort.c \ 99 99 100 ## @todo need some header for these CFG_LIBC defines. 101 $(PATH_LIBC_SRC)/libc/malloc/_hinitheap.c_DEFS.os2 = CFG_LIBC_HIGH_HEAP 102 100 103 # configure the variants. */ 101 104 $(call LIBC_CONFIG_VARIANT_LIBS,libc_libc_malloc) -
trunk/libc/src/libc/malloc/_hinitheap.c
r2254 r2741 2 2 /** @file 3 3 * 4 * High Memory Heap - init.4 * LIBC - High Memory Heap - init. 5 5 * 6 * Copyright (c) 2003 knut st. osmundsen <bird-srcspam@anduin.net>6 * Copyright (c) 2003-2006 knut st. osmundsen <bird-srcspam@anduin.net> 7 7 * 8 8 * … … 57 57 { 58 58 LIBCLOG_ENTER("\n"); 59 /* only one init at a time. */ 60 static _smutex lock; 59 static _smutex lock; /* only one init at a time. */ 60 Heap_t Heap; 61 62 #if CFG_LIBC_HIGH_HEAP 61 63 void * pvInitial; 62 64 size_t cbInitial; 63 65 int fClean; 64 Heap_t Heap;65 66 66 67 67 /* … … 95 95 { 96 96 _um_abort("_hinitheap: __libc_HimemDefaultAlloc failed!\n"); 97 LIBCLOG_ RETURN_P(NULL);97 LIBCLOG_ERROR_RETURN_P(NULL); 98 98 } 99 99 … … 108 108 { 109 109 _um_abort("_hinitheap: _ucreate2 failed!\n"); 110 LIBCLOG_ RETURN_P(NULL);110 LIBCLOG_ERROR_RETURN_P(NULL); 111 111 } 112 112 if (_uopen(Heap) != 0) 113 113 { 114 114 _um_abort("_hinitheap: _uopen(%p) failed!\n", Heap); 115 LIBCLOG_ RETURN_P(NULL);115 LIBCLOG_ERROR_RETURN_P(NULL); 116 116 } 117 117 … … 123 123 124 124 LIBCLOG_RETURN_P(Heap); 125 126 #else /* !CFG_LIBC_HIGH_HEAP */ 127 128 /* 129 * Return the low heap. 130 */ 131 _smutex_request(&lock); 132 Heap; Heap = _um_high_heap; 133 if (!_um_high_heap) 134 _um_high_heap = Heap = _linitheap(); 135 _smutex_release(&lock); 136 137 LIBCLOG_RETURN_P(Heap); 138 #endif /* !CFG_LIBC_HIGH_HEAP */ 125 139 } 126 140
Note:
See TracChangeset
for help on using the changeset viewer.