'\" t .\" Title: zmq_ctx_get_ext .\" Author: [see the "AUTHORS" section] .\" Generator: DocBook XSL Stylesheets vsnapshot .\" Date: 10/23/2023 .\" Manual: 0MQ Manual .\" Source: 0MQ 4.3.5 .\" Language: English .\" .TH "ZMQ_CTX_GET_EXT" "3" "10/23/2023" "0MQ 4\&.3\&.5" "0MQ Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" zmq_ctx_get_ext \- get extended context options .SH "SYNOPSIS" .sp \fBint zmq_ctx_get_ext (void \fR\fB\fI*context\fR\fR\fB, int \fR\fB\fIoption_name\fR\fR\fB, void \fR\fB\fI*option_value\fR\fR\fB, size_t \fR\fB\fI*option_len\fR\fR\fB);\fR .SH "DESCRIPTION" .sp The \fIzmq_ctx_get()\fR function shall retrieve the value for the option specified by the \fIoption_name\fR argument and store it in the buffer pointed to by the \fIoption_value\fR argument\&. The \fIoption_len\fR argument is the size in bytes of the buffer pointed to by \fIoption_value\fR; upon successful completion \fIzmq_ctx_get_ext()\fR shall modify the \fIoption_len\fR argument to indicate the actual size of the option value stored in the buffer\&. .sp The \fIzmq_ctx_get_ext()\fR function accepts all the option names accepted by \fIzmq_ctx_get()\fR\&. Options that make most sense to retrieve using \fIzmq_ctx_get_ext()\fR instead of \fIzmq_ctx_get()\fR are: .SS "ZMQ_THREAD_NAME_PREFIX: Get name prefix for I/O threads" .sp The \fIZMQ_THREAD_NAME_PREFIX\fR argument gets the string prefix of each thread created for the internal context\(cqs thread pool\&. .TS tab(:); lt lt lt lt lt lt. T{ .sp Option value type T}:T{ .sp character string T} T{ .sp Option value unit T}:T{ .sp N/A T} T{ .sp Default value T}:T{ .sp empty string T} .TE .sp 1 .SH "RETURN VALUE" .sp The \fIzmq_ctx_get_ext()\fR function returns a value of 0 or greater if successful\&. Otherwise it returns \-1 and sets \fIerrno\fR to one of the values defined below\&. .SH "ERRORS" .PP \fBEINVAL\fR .RS 4 The requested option \fIoption_name\fR is unknown\&. .RE .PP \fBEFAULT\fR .RS 4 The provided \fIcontext\fR is invalid\&. .RE .SH "EXAMPLE" .PP \fBSetting a prefix on internal ZMQ thread names:\fR. .sp .if n \{\ .RS 4 .\} .nf void *context = zmq_ctx_new (); const char prefix[] = "MyApp"; size_t prefixLen = sizeof(prefix); zmq_ctx_set (context, ZMQ_THREAD_NAME_PREFIX, &prefix, &prefixLen); char buff[256]; size_t buffLen = sizeof(buff); int rc = zmq_ctx_get (context, ZMQ_THREAD_NAME_PREFIX, &buff, &buffLen); assert (rc == 0); assert (buffLen == prefixLen); .fi .if n \{\ .RE .\} .sp .SH "SEE ALSO" .sp \fBzmq_ctx_get\fR(3) \fBzmq\fR(7) .SH "AUTHORS" .sp This page was written by the 0MQ community\&. To make a change please read the 0MQ Contribution Policy at \m[blue]\fBhttp://www\&.zeromq\&.org/docs:contributing\fR\m[]\&.