summaryrefslogtreecommitdiffstats
path: root/lib/libc/nls
diff options
context:
space:
mode:
authorjasone <jasone@FreeBSD.org>2000-01-12 09:23:48 +0000
committerjasone <jasone@FreeBSD.org>2000-01-12 09:23:48 +0000
commit75903038bc52105bc7479fe5f2b75f22f10c1c50 (patch)
treec9e28eda650bbd7eaa3eb22c8d7c75d00a96a451 /lib/libc/nls
parent688bb99b3f790aad607b949661d0361486bbe346 (diff)
downloadFreeBSD-src-75903038bc52105bc7479fe5f2b75f22f10c1c50.zip
FreeBSD-src-75903038bc52105bc7479fe5f2b75f22f10c1c50.tar.gz
Add three-tier symbol naming in support of POSIX thread cancellation
points. For library functions, the pattern is __sleep() <-- _libc_sleep() <-- sleep(). The arrows represent weak aliases. For system calls, the pattern is _read() <-- _libc_read() <-- read().
Diffstat (limited to 'lib/libc/nls')
-rw-r--r--lib/libc/nls/msgcat.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/lib/libc/nls/msgcat.c b/lib/libc/nls/msgcat.c
index 0e11ee2..bdb089a 100644
--- a/lib/libc/nls/msgcat.c
+++ b/lib/libc/nls/msgcat.c
@@ -285,7 +285,7 @@ nl_catd catd;
return -1;
}
- if (cat->loadType != MCLoadAll) close(cat->fd);
+ if (cat->loadType != MCLoadAll) _libc_close(cat->fd);
for (i = 0; i < cat->numSets; ++i) {
set = cat->sets + i;
if (!set->invalid) {
@@ -321,14 +321,15 @@ __const char *catpath;
if (!cat) return(NLERR);
cat->loadType = MCLoadBySet;
- if ((cat->fd = open(catpath, O_RDONLY)) < 0) {
+ if ((cat->fd = _libc_open(catpath, O_RDONLY)) < 0) {
free(cat);
return(NLERR);
}
- (void)fcntl(cat->fd, F_SETFD, FD_CLOEXEC);
+ (void)_libc_fcntl(cat->fd, F_SETFD, FD_CLOEXEC);
- if (read(cat->fd, &header, sizeof(header)) != sizeof(header)) CORRUPT();
+ if (_libc_read(cat->fd, &header, sizeof(header)) != sizeof(header))
+ CORRUPT();
if (strncmp(header.magic, MCMagic, MCMagicLen) != 0) CORRUPT();
@@ -368,7 +369,7 @@ __const char *catpath;
/* read in the set header */
set = cat->sets + i;
- if (read(cat->fd, set, sizeof(*set)) != sizeof(*set)) {
+ if (_libc_read(cat->fd, set, sizeof(*set)) != sizeof(*set)) {
for (j = 0; j < i; j++) {
set = cat->sets + j;
if (!set->invalid) {
@@ -407,7 +408,7 @@ __const char *catpath;
nextSet = set->nextSet;
}
if (cat->loadType == MCLoadAll) {
- close(cat->fd);
+ _libc_close(cat->fd);
cat->fd = -1;
}
return((nl_catd) cat);
@@ -423,7 +424,7 @@ MCSetT *set;
/* Get the data */
if (lseek(cat->fd, set->data.off, 0) == -1) return(0);
if ((set->data.str = malloc(set->dataLen)) == NULL) return(-1);
- if (read(cat->fd, set->data.str, set->dataLen) != set->dataLen) {
+ if (_libc_read(cat->fd, set->data.str, set->dataLen) != set->dataLen) {
free(set->data.str); return(0);
}
@@ -437,7 +438,7 @@ MCSetT *set;
for (i = 0; i < set->numMsgs; ++i) {
msg = set->u.msgs + i;
- if (read(cat->fd, msg, sizeof(*msg)) != sizeof(*msg)) {
+ if (_libc_read(cat->fd, msg, sizeof(*msg)) != sizeof(*msg)) {
free(set->u.msgs); free(set->data.str); return(0);
}
if (msg->invalid) {
OpenPOWER on IntegriCloud