summaryrefslogtreecommitdiff
path: root/main/SAPI.c
diff options
context:
space:
mode:
authorZeev Suraski <zeev@php.net>2000-02-10 17:26:57 +0000
committerZeev Suraski <zeev@php.net>2000-02-10 17:26:57 +0000
commit7d926a0e0c0862b4469200b5ebb7cc85c263b2dc (patch)
tree01b0f0522ad4a4e3b2929e03b9985b3bfa57fc76 /main/SAPI.c
parentec0e2d7312ba5e55bb4ffb2f35b72e19a48ee89a (diff)
downloadphp-git-7d926a0e0c0862b4469200b5ebb7cc85c263b2dc.tar.gz
More cleanup...
Diffstat (limited to 'main/SAPI.c')
-rw-r--r--main/SAPI.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/main/SAPI.c b/main/SAPI.c
index d1c684f1e1..e1b329daee 100644
--- a/main/SAPI.c
+++ b/main/SAPI.c
@@ -19,6 +19,7 @@
*/
#include <ctype.h>
+#include <sys/stat.h>
#include "php.h"
#include "SAPI.h"
@@ -383,3 +384,21 @@ SAPI_API int sapi_flush()
return FAILURE;
}
}
+
+SAPI_API int sapi_get_uid()
+{
+ SLS_FETCH();
+
+ if (sapi_module.get_uid) {
+ return sapi_module.get_uid(SLS_C);
+ } else {
+ struct stat statbuf;
+
+ if (!SG(request_info).path_translated || (stat(SG(request_info).path_translated, &statbuf)==-1)) {
+ return -1;
+ }
+
+ stat(SG(request_info).path_translated, &statbuf);
+ return statbuf.st_uid;
+ }
+}