{
long pid, sig;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ll", &pid, &sig) == FAILURE)
- return;
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ll", &pid, &sig) == FAILURE) {
+ RETURN_FALSE;
+ }
if (kill(pid, sig) < 0) {
POSIX_G(last_error) = errno;
{
pid_t pid;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "") == FAILURE)
- return;
-
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "") == FAILURE) {
+ RETURN_FALSE;
+ }
+
pid = getpid();
RETURN_LONG(pid);
}
{
pid_t ppid;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "") == FAILURE)
- return;
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "") == FAILURE) {
+ RETURN_FALSE;
+ }
ppid = getppid();
RETURN_LONG(ppid);
{
uid_t uid;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "") == FAILURE)
- return;
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "") == FAILURE) {
+ RETURN_FALSE;
+ }
uid = getuid();
RETURN_LONG(uid);
{
gid_t gid;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "") == FAILURE)
- return;
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "") == FAILURE) {
+ RETURN_FALSE;
+ }
gid = getgid();
RETURN_LONG(gid);
{
uid_t uid;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "") == FAILURE)
- return;
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "") == FAILURE) {
+ RETURN_FALSE;
+ }
uid = geteuid();
RETURN_LONG(uid);
{
gid_t gid;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "") == FAILURE)
- return;
-
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "") == FAILURE) {
+ RETURN_FALSE;
+ }
+
gid = getegid();
RETURN_LONG(gid);
}
{
long uid;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &uid) == FAILURE)
- return;
-
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &uid) == FAILURE) {
+ RETURN_FALSE;
+ }
+
if (setuid(uid) < 0) {
POSIX_G(last_error) = errno;
RETURN_FALSE;
{
long gid;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &gid) == FAILURE)
- return;
-
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &gid) == FAILURE) {
+ RETURN_FALSE;
+ }
+
if (setgid(gid) < 0) {
POSIX_G(last_error) = errno;
RETURN_FALSE;
{
long euid;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &euid) == FAILURE)
- return;
-
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &euid) == FAILURE) {
+ RETURN_FALSE;
+ }
+
if (seteuid(euid) < 0) {
POSIX_G(last_error) = errno;
RETURN_FALSE;
{
long egid;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &egid) == FAILURE)
- return;
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &egid) == FAILURE) {
+ RETURN_FALSE;
+ }
if (setegid(egid) < 0) {
POSIX_G(last_error) = errno;
int result;
int i;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "") == FAILURE)
- return;
-
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "") == FAILURE) {
+ RETURN_FALSE;
+ }
+
if ((result = getgroups(NGROUPS_MAX, gidlist)) < 0) {
POSIX_G(last_error) = errno;
RETURN_FALSE;
{
char *p;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "") == FAILURE)
- return;
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "") == FAILURE) {
+ RETURN_FALSE;
+ }
if (NULL == (p = getlogin())) {
POSIX_G(last_error) = errno;
{
pid_t pgrp;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "") == FAILURE)
- return;
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "") == FAILURE) {
+ RETURN_FALSE;
+ }
pgrp = getpgrp();
RETURN_LONG(pgrp);
{
pid_t sid;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "") == FAILURE)
- return;
-
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "") == FAILURE) {
+ RETURN_FALSE;
+ }
+
sid = setsid();
RETURN_LONG(sid);
}
{
long pid, pgid;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ll", &pid, &pgid) == FAILURE)
- return;
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ll", &pid, &pgid) == FAILURE) {
+ RETURN_FALSE;
+ }
if (setpgid(pid, pgid) < 0) {
POSIX_G(last_error) = errno;
long pid;
pid_t pgid;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &pid) == FAILURE)
- return;
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &pid) == FAILURE) {
+ RETURN_FALSE;
+ }
if ((pgid = getpgid(pid)) < 0) {
POSIX_G(last_error) = errno;
long pid;
pid_t sid;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &pid) == FAILURE)
- return;
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &pid) == FAILURE) {
+ RETURN_FALSE;
+ }
if ((sid = getsid(pid)) < 0) {
POSIX_G(last_error) = errno;
{
struct utsname u;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "") == FAILURE)
- return;
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "") == FAILURE) {
+ RETURN_FALSE;
+ }
if (uname(&u) < 0) {
POSIX_G(last_error) = errno;
struct tms t;
clock_t ticks;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "") == FAILURE)
- return;
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "") == FAILURE) {
+ RETURN_FALSE;
+ }
if((ticks = times(&t)) < 0) {
POSIX_G(last_error) = errno;
{
char buffer[L_ctermid];
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "") == FAILURE)
- return;
-
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "") == FAILURE) {
+ RETURN_FALSE;
+ }
+
if (NULL == ctermid(buffer)) {
/* Found no documentation how the defined behaviour is when this
* function fails
char *p;
int fd;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &z_fd) == FAILURE)
- return;
-
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &z_fd) == FAILURE) {
+ RETURN_FALSE;
+ }
+
switch (Z_TYPE_P(z_fd)) {
case IS_RESOURCE:
if (!php_posix_stream_get_fd(z_fd, &fd TSRMLS_CC)) {
zval *z_fd;
int fd;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &z_fd) == FAILURE)
- return;
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &z_fd) == FAILURE) {
+ RETURN_FALSE;
+ }
switch (Z_TYPE_P(z_fd)) {
case IS_RESOURCE:
char buffer[MAXPATHLEN];
char *p;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "") == FAILURE)
- return;
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "") == FAILURE) {
+ RETURN_FALSE;
+ }
p = VCWD_GETCWD(buffer, MAXPATHLEN);
if (!p) {
long mode;
int result;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sl", &path, &path_len, &mode) == FAILURE)
- return;
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sl", &path, &path_len, &mode) == FAILURE) {
+ RETURN_FALSE;
+ }
if (PG(safe_mode) && (!php_checkuid(path, NULL, CHECKUID_ALLOW_ONLY_DIR))) {
RETURN_FALSE;
struct group *g;
int name_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &name, &name_len) == FAILURE)
- return;
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &name, &name_len) == FAILURE) {
+ RETURN_FALSE;
+ }
if (NULL == (g = getgrnam(name))) {
POSIX_G(last_error) = errno;
long gid;
struct group *g;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &gid) == FAILURE)
- return;
-
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &gid) == FAILURE) {
+ RETURN_FALSE;
+ }
+
if (NULL == (g = getgrgid(gid))) {
POSIX_G(last_error) = errno;
RETURN_FALSE;
char *name;
int name_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &name, &name_len) == FAILURE)
- return;
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &name, &name_len) == FAILURE) {
+ RETURN_FALSE;
+ }
if (NULL == (pw = getpwnam(name))) {
POSIX_G(last_error) = errno;
long uid;
struct passwd *pw;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &uid) == FAILURE)
- return;
-
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &uid) == FAILURE) {
+ RETURN_FALSE;
+ }
+
if (NULL == (pw = getpwuid(uid))) {
POSIX_G(last_error) = errno;
RETURN_FALSE;
{
struct limitlist *l = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "") == FAILURE)
- return;
-
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "") == FAILURE) {
+ RETURN_FALSE;
+ }
+
if (array_init(return_value) == FAILURE) {
RETURN_FALSE;
}
Retrieve the error number set by the last posix function which failed. */
PHP_FUNCTION(posix_get_last_error)
{
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "") == FAILURE)
- return;
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "") == FAILURE) {
+ RETURN_FALSE;
+ }
RETURN_LONG(POSIX_G(last_error));
}
{
long error;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &error) == FAILURE)
- return;
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &error) == FAILURE) {
+ RETURN_FALSE;
+ }
RETURN_STRING(strerror(error), 1);
}