Sun Java System Web Server 6.1 SP6 NSAPI Programmer's Guide



The util_can_exec function checks that a specified file can be executed, returning either a 1 (executable) or a 0. The function checks if the file can be executed by the user with the given user and group ID.

Use this function before executing a program using the exec system call.


int util_can_exec(struct stat *finfo, uid_t uid, gid_t gid);


1 if the file is executable, or 0 if the file is not executable.


stat *finfo is the stat structure associated with a file.

uid_t uid is the UNIX user id.

gid_t gid is the UNIX group id. Together with uid, this determines the permissions of the UNIX user.

See Also

util_env_create, util_getline, util_hostname