Codificar en Base64 paso a paso con PowerShell

Windows services (detailed)

 

Windows services

 

Realizar captura de pantalla y guardar con formato de imagen de mapa de bits (BMP)

 

shmctl (System Call)

NAME

shmctl – XSI shared memory control operations

SYNOPSIS

DESCRIPTION

The shmctl() function operates on XSI shared memory (see the Base Definitions volume of IEEE Std 1003.1-2001, Section 3.340, Shared Memory Object). It is unspecified whether this function interoperates with the realtime interprocess communication facilities defined in Realtime.

The shmctl() function provides a variety of shared memory control operations as specified by cmd. The following values for cmd are available:

IPC_STAT

Place the current value of each member of the shmid_ds data structure associated with shmid into the structure pointed to by buf. The contents of the structure are defined in <sys/shm.h>.

IPC_SET

Set the value of the following members of the shmid_ds data structure associated with shmid to the corresponding value found in the structure pointed to by buf:
shm_perm.uid
shm_perm.gid
shm_perm.mode Low-order nine bits.
IPC_SET can only be executed by a process that has an effective user ID equal to either that of a process with appropriate privileges or to the value of shm_perm.cuid or shm_perm.uid in the shmid_ds data structure associated with shmid.

IPC_RMID

Remove the shared memory identifier specified by shmid from the system and destroy the shared memory segment and shmid_ds data structure associated with it. IPC_RMID can only be executed by a process that has an effective user ID equal to either that of a process with appropriate privileges or to the value of shm_perm.cuid or shm_perm.uid in the shmid_ds data structure associated with shmid.

RETURN VALUE

Upon successful completion, shmctl() shall return 0; otherwise, it shall return -1 and set errno to indicate the error.

ERRORS

The shmctl() function shall fail if:

[EACCES]
The argument cmd is equal to IPC_STAT and the calling process does not have read permission; see XSI Interprocess Communication.
[EINVAL]
The value of shmid is not a valid shared memory identifier, or the value of cmd is not a valid command.
[EPERM]
The argument cmd is equal to IPC_RMID or IPC_SET and the effective user ID of the calling process is not equal to that of a process with appropriate privileges and it is not equal to the value of shm_perm.cuid or shm_perm.uid in the data structure associated with shmid.

The shmctl() function may fail if:

[EOVERFLOW]
The cmd argument is IPC_STAT and the gid or uid value is too large to be stored in the structure pointed to by the buf argument.

ftok (System Call)

NAME

ftok – generate an IPC key

SYNOPSIS

DESCRIPTION

The ftok() function shall return a key based on path and id that is usable in subsequent calls to msgget(), semget(), and shmget(). The application shall ensure that the path argument is the pathname of an existing file that the process is able to stat().

The ftok() function shall return the same key value for all paths that name the same file, when called with the same id value, and return different key values when called with different id values or with paths that name different files existing on the same file system at the same time. It is unspecified whether ftok() shall return the same key value when called again after the file named by path is removed and recreated with the same name.

Only the low-order 8-bits of id are significant. The behavior of ftok() is unspecified if these bits are 0.

RETURN VALUE

Upon successful completion, ftok() shall return a key. Otherwise, ftok() shall return (key_t)-1 and set errno to indicate the error.

ERRORS

The ftok() function shall fail if:

[EACCES]
Search permission is denied for a component of the path prefix.

[ELOOP]
A loop exists in symbolic links encountered during resolution of the path argument

[ENAMETOOLONG]
The length of the path argument exceeds {PATH_MAX} or a pathname component is longer than {NAME_MAX}.

[ENOENT]
A component of path does not name an existing file or path is an empty string

[ENOTDIR]
A component of the path prefix is not a directory.

The ftok() function may fail if:

[ELOOP]
More than {SYMLOOP_MAX} symbolic links were encountered during resolution of the path argument.

[ENAMETOOLONG]
Pathname resolution of a symbolic link produced an intermediate result whose length exceeds {PATH_MAX}.

umask (System Call)

NAME

umask – set and get the file mode creation mask

SYNOPSIS

DESCRIPTION

The umask() function shall set the process‘ file mode creation mask to cmask and return the previous value of the mask. Only the file permission bits of cmask (see <sys/stat.h>) are used; the meaning of the other bits is implementation-defined.

The process‘ file mode creation mask is used to turn off permission bits in the mode argument supplied during calls to the following functions:

  • open(), creat(), mkdir(), and mkfifo()
  • mknod()
  • mq_open()
  • sem_open()

Bit positions that are set in cmask are cleared in the mode of the created file.

RETURN VALUE

The file permission bits in the value returned by umask() shall be the previous value of the file mode creation mask. The state of any other bits in that value is unspecified, except that a subsequent call to umask() with the returned value as cmask shall leave the state of the mask the same as its state before the first call, including any unspecified use of those bits.

ERRORS

No errors are defined.

shmget (System Call)

NAME

shmget – get an XSI shared memory segment

SYNOPSIS

DESCRIPTION

The shmget() function operates on XSI shared memory (see the Base Definitions volume of IEEE Std 1003.1-2001, Section 3.340, Shared Memory Object). It is unspecified whether this function interoperates with the realtime interprocess communication facilities defined in Realtime.

The shmget() function shall return the shared memory identifier associated with key.

A shared memory identifier, associated data structure, and shared memory segment of at least size bytes (see <sys/shm.h>) are created for key if one of the following is true:

The argument key is equal to IPC_PRIVATE.

The argument key does not already have a shared memory identifier associated with it and (shmflg &IPC_CREAT) is non-zero.

Upon creation, the data structure associated with the new shared memory identifier shall be initialized as follows:

The values of shm_perm.cuid, shm_perm.uid, shm_perm.cgid, and shm_perm.gid are set equal to the effective user ID and effective group ID, respectively, of the calling process.

The low-order nine bits of shm_perm.mode are set equal to the low-order nine bits of shmflg.

The value of shm_segsz is set equal to the value of size.

The values of shm_lpid, shm_nattch, shm_atime, and shm_dtime are set equal to 0.

The value of shm_ctime is set equal to the current time.

When the shared memory segment is created, it shall be initialized with all zero values.

RETURN VALUE

Upon successful completion, shmget() shall return a non-negative integer, namely a shared memory identifier; otherwise, it shall return -1 and set errno to indicate the error.

ERRORS

The shmget() function shall fail if:

[EACCES
A shared memory identifier exists for key but operation permission as specified by the low-order nine bits of shmflg would not be granted; see XSI Interprocess Communication.
[EEXIST]
A shared memory identifier exists for the argument key but (shmflg &IPC_CREAT) &&(shmflg &IPC_EXCL) is non-zero.
[EINVAL]
A shared memory segment is to be created and the value of size is less than the system-imposed minimum or greater than the system-imposed maximum.
[EINVAL]
No shared memory segment is to be created and a shared memory segment exists for key but the size of the segment associated with it is less than size and size is not 0.
[ENOENT]
A shared memory identifier does not exist for the argument key and (shmflg &IPC_CREAT) is 0.
[ENOMEM]
A shared memory identifier and associated shared memory segment shall be created, but the amount of available physical memory is not sufficient to fill the request.
[ENOSPC]
A shared memory identifier is to be created, but the system-imposed limit on the maximum number of allowed shared memory identifiers system-wide would be exceeded.

chown (System Call)

NAME

chown – change owner and group of a file

SYNOPSIS

DESCRIPTION

The chown() function shall change the user and group ownership of a file.

The path argument points to a pathname naming a file. The user ID and group ID of the named file shall be set to the numeric values contained in owner and group, respectively.

Only processes with an effective user ID equal to the user ID of the file or with appropriate privileges may change the ownership of a file. If _POSIX_CHOWN_RESTRICTED is in effect for path:

  • Changing the user ID is restricted to processes with appropriate privileges.
  • Changing the group ID is permitted to a process with an effective user ID equal to the user ID of the file, but without appropriate privileges, if and only if owner is equal to the file’s user ID or ( uid_t)-1 and group is equal either to the calling process‘ effective group ID or to one of its supplementary group IDs.

If the specified file is a regular file, one or more of the S_IXUSR, S_IXGRP, or S_IXOTH bits of the file mode are set, and the process does not have appropriate privileges, the set-user-ID (S_ISUID) and set-group-ID (S_ISGID) bits of the file mode shall be cleared upon successful return from chown(). If the specified file is a regular file, one or more of the S_IXUSR, S_IXGRP, or S_IXOTH bits of the file mode are set, and the process has appropriate privileges, it is implementation-defined whether the set-user-ID and set-group-ID bits are altered. If the chown() function is successfully invoked on a file that is not a regular file and one or more of the S_IXUSR, S_IXGRP, or S_IXOTH bits of the file mode are set, the set-user-ID and set-group-ID bits may be cleared.

If owner or group is specified as ( uid_t)-1 or ( gid_t)-1, respectively, the corresponding ID of the file shall not be changed. If both owner and group are -1, the times need not be updated.

Upon successful completion, chown() shall mark for update the st_ctime field of the file.

RETURN VALUE

Upon successful completion, 0 shall be returned; otherwise, -1 shall be returned and errno set to indicate the error. If -1 is returned, no changes are made in the user ID and group ID of the file.

ERRORS

The chown() function shall fail if:

[EACCES]
Search permission is denied on a component of the path prefix.
[ELOOP]
A loop exists in symbolic links encountered during resolution of the path argument.
[ENAMETOOLONG]
The length of the path argument exceeds {PATH_MAX} or a pathname component is longer than {NAME_MAX}.
[ENOTDIR]
A component of the path prefix is not a directory.
[ENOENT]
A component of path does not name an existing file or path is an empty string.
[EPERM]
The effective user ID does not match the owner of the file, or the calling process does not have appropriate privileges and _POSIX_CHOWN_RESTRICTED indicates that such privilege is required.
[EROFS]
The named file resides on a read-only file system.
The chown() function may fail if:

[EIO]
An I/O error occurred while reading or writing to the file system.
[EINTR]
The chown() function was interrupted by a signal which was caught.
[EINVAL]
The owner or group ID supplied is not a value supported by the implementation.
[ELOOP]
More than {SYMLOOP_MAX} symbolic links were encountered during resolution of the path argument.
[ENAMETOOLONG]
As a result of encountering a symbolic link in resolution of the path argument, the length of the substituted pathname string exceeded {PATH_MAX}.

chmod (System Call)

NAME

chmod – change mode of a file

SYNOPSIS

DESCRIPTION

The chmod() function shall change S_ISUID, S_ISGID, [XSI] [Option Start] S_ISVTX, [Option End] and the file permission bits of the file named by the pathname pointed to by the path argument to the corresponding bits in the mode argument. The application shall ensure that the effective user ID of the process matches the owner of the file or the process has appropriate privileges in order to do this.

S_ISUID, S_ISGID, S_ISVTX, and the file permission bits are described in <sys/stat.h>.

If the calling process does not have appropriate privileges, and if the group ID of the file does not match the effective group ID or one of the supplementary group IDs and if the file is a regular file, bit S_ISGID (set-group-ID on execution) in the file’s mode shall be cleared upon successful return from chmod().

Additional implementation-defined restrictions may cause the S_ISUID and S_ISGID bits in mode to be ignored.

The effect on file descriptors for files open at the time of a call to chmod() is implementation-defined.

Upon successful completion, chmod() shall mark for update the st_ctime field of the file.

RETURN VALUE

Upon successful completion, 0 shall be returned; otherwise, -1 shall be returned and errno set to indicate the error. If -1 is returned, no change to the file mode occurs.

ERRORS

The chmod() function shall fail if:
[EACCES]
Search permission is denied on a component of the path prefix.
[ELOOP]
A loop exists in symbolic links encountered during resolution of the path argument.
[ENAMETOOLONG]
The length of the path argument exceeds {PATH_MAX} or a pathname component is longer than {NAME_MAX}.
[ENOTDIR]
A component of the path prefix is not a directory.
[ENOENT]
A component of path does not name an existing file or path is an empty string.
[EPERM]
The effective user ID does not match the owner of the file and the process does not have appropriate privileges.
[EROFS]
The named file resides on a read-only file system.

The chmod() function may fail if:
[EINTR]
A signal was caught during execution of the function.
[EINVAL]
The value of the mode argument is invalid.
[ELOOP]
More than {SYMLOOP_MAX} symbolic links were encountered during resolution of the path argument.
[ENAMETOOLONG]
As a result of encountering a symbolic link in resolution of the path argument, the length of the substituted pathname strings exceeded {PATH_MAX}.