Skip Navigation Links | |
Exit Print View | |
man pages section 3: Basic Library Functions Oracle Solaris 11.1 Information Library |
enable_extended_FILE_stdio(3C)
posix_spawnattr_getschedparam(3C)
posix_spawnattr_getschedpolicy(3C)
posix_spawnattr_getsigdefault(3C)
posix_spawnattr_getsigignore_np(3C)
posix_spawnattr_getsigmask(3C)
posix_spawnattr_setschedparam(3C)
posix_spawnattr_setschedpolicy(3C)
posix_spawnattr_setsigdefault(3C)
posix_spawnattr_setsigignore_np(3C)
posix_spawnattr_setsigmask(3C)
posix_spawn_file_actions_addclose(3C)
posix_spawn_file_actions_addclosefrom_np(3C)
posix_spawn_file_actions_adddup2(3C)
posix_spawn_file_actions_addopen(3C)
posix_spawn_file_actions_destroy(3C)
posix_spawn_file_actions_init(3C)
pthread_attr_getdetachstate(3C)
pthread_attr_getinheritsched(3C)
pthread_attr_getschedparam(3C)
pthread_attr_getschedpolicy(3C)
pthread_attr_setdetachstate(3C)
pthread_attr_setinheritsched(3C)
pthread_attr_setschedparam(3C)
pthread_attr_setschedpolicy(3C)
pthread_barrierattr_destroy(3C)
pthread_barrierattr_getpshared(3C)
pthread_barrierattr_setpshared(3C)
pthread_condattr_getpshared(3C)
pthread_condattr_setpshared(3C)
pthread_cond_reltimedwait_np(3C)
pthread_key_create_once_np(3C)
pthread_mutexattr_getprioceiling(3C)
pthread_mutexattr_getprotocol(3C)
pthread_mutexattr_getpshared(3C)
pthread_mutexattr_getrobust(3C)
pthread_mutexattr_setprioceiling(3C)
pthread_mutexattr_setprotocol(3C)
pthread_mutexattr_setpshared(3C)
pthread_mutexattr_setrobust(3C)
pthread_mutex_getprioceiling(3C)
pthread_mutex_reltimedlock_np(3C)
pthread_mutex_setprioceiling(3C)
pthread_rwlockattr_destroy(3C)
pthread_rwlockattr_getpshared(3C)
pthread_rwlockattr_setpshared(3C)
pthread_rwlock_reltimedrdlock_np(3C)
pthread_rwlock_reltimedwrlock_np(3C)
pthread_rwlock_timedrdlock(3C)
pthread_rwlock_timedwrlock(3C)
rctlblk_get_enforced_value(3C)
- control and query iconv code conversion behavior
#include <iconv.h> int iconvctl(iconv_t cd, int request, void *arg);
The iconvctl() function can be used to control iconv code conversion behavior by setting or getting the current iconv code conversion behavior settings from the current code conversion pointed to by the conversion descriptor cdthat was returned from a successful iconv_open(3C) call.
The following are the supported values for the request argument:
With this request, if query is successful, the function returns the current iconv code conversion behavior represented in a bitwise-inclusive-OR of the following values into an int variable that is pointed to by the arg argument as an int *:
The current code conversion silently discards any illegal input bytes.
The current code conversion replaces illegal input bytes into hexadecimal number sequences as described in iconv_open(3C).
The current code conversion restores hexadecimal number sequences originated from illegal input bytes into actual byte values.
The current code conversion discards non-identical characters.
The current code conversion replaces bytes of non-identical characters into hexadecimal number sequences as described in iconv_open(3C).
The current code conversion restores hexadecimal number sequences originated from non-identical characters into actual byte values.
The current code conversion tries to transliterate non-identical characters as much as it can.
For more details on the above iconv code conversion behaviors, refer to iconv_open(3C).
With this request, the function tries to set a specific set of code conversion behavior as instructed by the arg argument which is a pointer to an int that has a bitwise-inclusive-OR of the following values:
Instruct the current code conversion to silently discard any illegal input bytes.
Instruct the current code conversion to replace illegal input bytes into hexadecimal number sequences.
Instruct the current code conversion to restore hexadecimal number sequences originated from illegal input bytes into actual byte values.
Instruct the current code conversion to discard non-identical characters.
Instruct the current code conversion to replace bytes of non-identical characters into hexadecimal number sequences.
Instruct the current code conversion to restore hexadecimal number sequences originated from non-identical characters into actual byte values.
Instruct the current code conversion to transliterate non-identical characters as much as it can.
When conflicting values are specified together, the values for discarding and then replacing into hexadecimal numbers will supersede other values specified.
For more details on the above iconv code conversion behaviors, refer to iconv_open(3C).
With this request, upon successful completion, the function saves 1 into an int variable that is pointed to by the arg argument if the current code conversion discards illegal and non-identical characters from the input buffer. Otherwise, it saves 0.
With this request and a pointer to a const int with a non-zero value, caller can instruct the current conversion to discard illegal and non-identical characters from the input buffer during the code conversion. The value of zero, on the other hand, turns it off.
With this request, upon successful completion, the function saves 1 into an int variable that is pointed to by the arg argument if the current code conversion transliterates non-identical characters from the input buffer. Otherwise, it saves 0.
With this request and a pointer to a const int with a non-zero value, caller can instruct the current conversion to transliterate non-identical characters from the input buffer during the code conversion as much as it can. The value of zero, on the other hand, turns it off.
With this request, upon successful completion, the function saves 1 into an int variable that is pointed to by the arg argument if the current code conversion is a trivial iconv code conversion. Otherwise, it saves 0. (In Solaris, the trivial iconv code conversion is a simple 1-to-1 mapping table based or single-step iconv code conversion requiring no complex algorithm or data structures. This classification is largely subjective and informative only in nature.)
Upon successful completion, iconvctl() returns 0 and, optionally, with a value pointed to by the arg argument. Otherwise, iconvctl() returns -1 and sets errno to indicate the error.
The iconvctl() function will fail if:
The conversion descriptor is invalid.
One or more of the requests are invalid.
One or more of the requests are not supported by the corresponding code conversion implementation.
Example 1 Use iconvctl() to discard illegal characters and replace non-identical characters into hexadecimal number sequences.
#include <stdio.h> #include <errno.h> #include <iconv.h> : iconv_t cd; int r; int status; : status = (ICONV_CONV_ILLEGAL_DISCARD | ICONV_CONV_NON_IDENTICAL_REPLACE_HEX); r = iconvctl(cd, ICONV_SET_CONVERSION_BEHAVIOR, (void *)&status); if (r == -1) { (void) fprintf(stderr, "iconvctl() failed due to "); if (errno == EBADF) { (void) fprintf(stderr, "invalid conversion descriptor.\n"); } else if (errno == EINVAL) { (void) fprintf(stderr, "invalid request.\n"); } else if (errno == ENOTSUP) { (void) fprintf(stderr, "unsupported request.\n"); } else { /* * This shouldn't happen; this is only to make your code * robust. */ (void) fprintf(stderr, "unknown reason.\n"); } return (1); } return (0);
Example 2 Query to determine if the current conversion is doing transliteration on non-identical characters.
#include <stdio.h> #include <errno.h> #include <iconv.h> : iconv_t cd; int status; int r; : r = iconvctl(cd, ICONV_GET_TRANSLITERATE, (void *)&status); if (r == -1) { (void) fprintf(stderr, "iconvctl() failed (errno = %d)\n", errno); return (-1); } return (status);
See attributes(5) for descriptions of the following attributes:
|
geniconvtbl(1), iconv(1), iconv(3C), iconv_close(3C), iconv_open(3C), iconvstr(3C), iconv.h(3HEAD), geniconvtbl(4), attributes(5), standards(5)
It is unsafe for any thread to call iconvctl() to change the current code conversion behavior while there is iconv(3C) being called by any other thread with the same conversion descriptor in the application since such will yield unpredictable code conversion behavior change in the middle of code conversion. To change the code conversion behavior in a multi-threaded application, call iconvctl() prior to any iconv() call with the same conversion descriptor or wait for existing iconv()iconv(3C) call to finish, reset the code conversion, call iconvctl(), and then call iconv() for a new code conversion behavior
It is safe to use iconvctl() to query the current code conversion behavior except when some other thread is changing the code conversion behavior.