Bugzilla bug 326110: declare PR_SetSysfdTableSize and PR_GetSysfdTableMax MOZILLA_1_8_BRANCH
authorwtchang%redhat.com
Tue, 07 Feb 2006 19:22:05 +0000
branchMOZILLA_1_8_BRANCH
changeset 3571 056dc03a19d938464e8978083a1b2b4125dbf116
parent 3569 a3854af0ab8da1129dbe6197282cb47ea0c12f91
child 3573 60f37caf929257134bf2f0a70d32778a00e6658d
push idunknown
push userunknown
push dateunknown
bugs326110
Bugzilla bug 326110: declare PR_SetSysfdTableSize and PR_GetSysfdTableMax with NSPR_API and use PR_IMPLEMENT with their definitions so that they can be exported from the NSPR shared library/DLL. r=kengert,jpierre. Thanks to Noriko Hosoi <nhosoi@redhat.com> for the bug report. Modified Files: probslet.h prfile.c ptio.c Tag: MOZILLA_1_8_BRANCH
pr/include/obsolete/probslet.h
pr/src/io/prfile.c
pr/src/pthreads/ptio.c
--- a/pr/include/obsolete/probslet.h
+++ b/pr/include/obsolete/probslet.h
@@ -153,16 +153,25 @@ NSPR_API(PRInt32) PR_Select(
 NSPR_API(void)        PR_FD_ZERO(PR_fd_set *set);
 NSPR_API(void)        PR_FD_SET(PRFileDesc *fd, PR_fd_set *set);
 NSPR_API(void)        PR_FD_CLR(PRFileDesc *fd, PR_fd_set *set);
 NSPR_API(PRInt32)     PR_FD_ISSET(PRFileDesc *fd, PR_fd_set *set);
 NSPR_API(void)        PR_FD_NSET(PRInt32 osfd, PR_fd_set *set);
 NSPR_API(void)        PR_FD_NCLR(PRInt32 osfd, PR_fd_set *set);
 NSPR_API(PRInt32)     PR_FD_NISSET(PRInt32 osfd, PR_fd_set *set);
 
+/*
+** The next two entry points should not be in the API, but they are
+** declared here for historical reasons.
+*/
+
+NSPR_API(PRInt32) PR_GetSysfdTableMax(void);
+
+NSPR_API(PRInt32) PR_SetSysfdTableSize(PRIntn table_size);
+
 #ifndef NO_NSPR_10_SUPPORT
 #ifdef XP_MAC
 #include <stat.h>
 #else
 #include <sys/stat.h>
 #endif
 
 NSPR_API(PRInt32) PR_Stat(const char *path, struct stat *buf);
--- a/pr/src/io/prfile.c
+++ b/pr/src/io/prfile.c
@@ -407,17 +407,17 @@ PR_IMPLEMENT(PRFileDesc*) PR_OpenFile(
             fd->secret->appendMode = appendMode;
 #endif
             _PR_MD_INIT_FD_INHERITABLE(fd, PR_FALSE);
         }
     }
     return fd;
 }
 
-PRInt32 PR_GetSysfdTableMax(void)
+PR_IMPLEMENT(PRInt32) PR_GetSysfdTableMax(void)
 {
 #if defined(XP_UNIX) && !defined(AIX) && !defined(NEXTSTEP) && !defined(QNX)
     struct rlimit rlim;
 
     if ( getrlimit(RLIMIT_NOFILE, &rlim) < 0) {
        /* XXX need to call PR_SetError() */
        return -1;
     }
@@ -440,17 +440,17 @@ PRInt32 PR_GetSysfdTableMax(void)
 #elif defined (XP_MAC) || defined(XP_BEOS)
     PR_SetError(PR_NOT_IMPLEMENTED_ERROR, 0);
    return -1;
 #else
     write me;
 #endif
 }
 
-PRInt32 PR_SetSysfdTableSize(int table_size)
+PR_IMPLEMENT(PRInt32) PR_SetSysfdTableSize(int table_size)
 {
 #if defined(XP_UNIX) && !defined(AIX) && !defined(NEXTSTEP) && !defined(QNX)
     struct rlimit rlim;
     PRInt32 tableMax = PR_GetSysfdTableMax();
 
     if (tableMax < 0) 
         return -1;
 
--- a/pr/src/pthreads/ptio.c
+++ b/pr/src/pthreads/ptio.c
@@ -4578,31 +4578,31 @@ PR_IMPLEMENT(PRStatus) PR_UnlockFile(PRF
     return status;
 }
 
 /*
  * The next two entry points should not be in the API, but they are
  * defined here for historical (or hysterical) reasons.
  */
 
-PRInt32 PR_GetSysfdTableMax(void)
+PR_IMPLEMENT(PRInt32) PR_GetSysfdTableMax(void)
 {
 #if defined(XP_UNIX) && !defined(AIX) && !defined(VMS)
     struct rlimit rlim;
 
     if ( getrlimit(RLIMIT_NOFILE, &rlim) < 0) 
        return -1;
 
     return rlim.rlim_max;
 #elif defined(AIX) || defined(VMS)
     return sysconf(_SC_OPEN_MAX);
 #endif
 }
 
-PRInt32 PR_SetSysfdTableSize(PRIntn table_size)
+PR_IMPLEMENT(PRInt32) PR_SetSysfdTableSize(PRIntn table_size)
 {
 #if defined(XP_UNIX) && !defined(AIX) && !defined(VMS)
     struct rlimit rlim;
     PRInt32 tableMax = PR_GetSysfdTableMax();
 
     if (tableMax < 0) return -1;
     rlim.rlim_max = tableMax;