posix_setgid Set the GID of the current process php函数


posix_setgid

(PHP 4, PHP 5)

posix_setgidSet the GID of the current process

说明

bool posix_setgid ( int $gid )

Set the real group ID of the current process. This is a privileged function and needs appropriate privileges (usually root) on the system to be able to perform this function. The appropriate order of function calls is posix_setgid() first, posix_setuid() last.

Note:

If the caller is a super user, this will also set the effective group id.

参数

gid

The group id.

返回值

成功时返回 TRUE, 或者在失败时返回 FALSE.

范例

Example #1 posix_setgid() example

This example will print out the effective group id, once it is changed.

<?php
echo 'My real group id is '.posix_getgid(); //20
posix_setgid(40);
echo 
'My real group id is '.posix_getgid(); //40
echo 'My effective group id is '.posix_getegid(); //40
?>

参见

  • posix_getgrgid() - Return info about a group by group id
  • posix_getgid() - Return the real group ID of the current process



相关阅读:
posix_setpgid Set process group id for job control
posix_setsid Make the current process a session leader
posix_setuid Set the UID of the current process
posix_strerror Retrieve the system error message associated with the given errno
posix_times Get process times
posix_ttyname Determine terminal device name
posix_uname Get system name
pow 指数表达式
preg_filter 执行一个正则表达式搜索和替换
preg_grep 返回匹配模式的数组条目
preg_last_error 返回最后一个PCRE正则执行产生的错误代码
preg_match 执行一个正则表达式匹配
preg_match_all 执行一个全局正则表达式匹配
preg_quote 转义正则表达式字符
快速导航

Copyright © 2016 phpStudy | 皖ICP备18014864号-4