Changeset 38
- Timestamp:
- 06/04/08 16:35:15
(6 months ago)
- Author:
- jtang
- Message:
Revised all man pages to match current API.
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r21 |
r38 |
|
| 1 | | .\" Copyright (C) 2006, 2007 Tresys Technology, LLC |
|---|
| | 1 | .\" Copyright (C) 2006 - 2008 Tresys Technology, LLC |
|---|
| 2 | 2 | .\" This file is distributed according to the GNU Lesser General Public License |
|---|
| 3 | 3 | .TH "SIPC_CLOSE" 3 "2006-08-10" "Linux 2.6" "Linux Programmer's Manual" |
|---|
| … | … | |
| 13 | 13 | .hy |
|---|
| 14 | 14 | .SH "DESCRIPTION" |
|---|
| 15 | | \fBsipc_close\fR() frees memory associated with a secure IPC handle |
|---|
| | 15 | \fBsipc_close\fR() frees memory associated with a secure IPC handle |
|---|
| 16 | 16 | that was obtained via \fBsipc_open\fR() and detaches from the |
|---|
| 17 | 17 | associated IPC resource. |
|---|
| | 18 | Nothing occurs if |
|---|
| | 19 | .IR sipc |
|---|
| | 20 | is NULL. |
|---|
| | 21 | Undefined behavior occurs if the same handle is closed multiple times. |
|---|
| | 22 | .P |
|---|
| 18 | 23 | Note that \fBsipc_close\fR() does not destroy the underlying IPC resource; |
|---|
| 19 | 24 | that is done by \fBsipc_unlink\fR(). |
|---|
| r21 |
r38 |
|
| 1 | | .\" Copyright (C) 2006, 2007 Tresys Technology, LLC |
|---|
| | 1 | .\" Copyright (C) 2006 - 2008 Tresys Technology, LLC |
|---|
| 2 | 2 | .\" This file is distributed according to the GNU Lesser General Public License |
|---|
| 3 | 3 | .TH "SIPC_ERROR" 3 "2006-08-10" "Linux 2.6" "Linux Programmer's Manual" |
|---|
| 4 | 4 | .SH NAME |
|---|
| 5 | | sipc_error \- Print messages for errors that occur during secure IPC. |
|---|
| | 5 | sipc_error \- Print messages for errors that occur during secure IPC |
|---|
| 6 | 6 | .SH "SYNOPSIS" |
|---|
| 7 | 7 | .ad l |
|---|
| … | … | |
| 9 | 9 | #include <sipc/sipc.h> |
|---|
| 10 | 10 | .HP 20 |
|---|
| 11 | | void\ \fBsipc_error\fR\ (sipc_t\ \fI*sipc\fR, char\ \fI*format\fR, ...); |
|---|
| | 11 | void\ \fBsipc_error\fR(sipc_t\ \fI*sipc\fR, char\ \fI*format\fR, ...); |
|---|
| 12 | 12 | .ad |
|---|
| 13 | 13 | .hy |
|---|
| 14 | 14 | .SH "DESCRIPTION" |
|---|
| 15 | | \fBsipc_error\fR is used for reporting errors that occur during secure IPC. |
|---|
| 16 | | This function recognizes \fBprintf(3)\fR style format strings. |
|---|
| | 15 | \fBsipc_error\fR is used for reporting errors that occur during secure IPC. |
|---|
| | 16 | This function recognizes \fBprintf(3)\fR style format strings. |
|---|
| 17 | 17 | .SH "RETURN VALUE" |
|---|
| 18 | 18 | This function has no return value. |
|---|
| 19 | 19 | .SH "SEE ALSO" |
|---|
| 20 | | \fBsipc_send_data(3)\fR, \fBsipc_connect(3)\fR, \fBsipc_disconnect(3)\fR. |
|---|
| | 20 | \fBsipc_open(3)\fR, \fBsipc_close(3)\fR |
|---|
| 21 | 21 | .SH AUTHOR |
|---|
| 22 | 22 | David Windsor <dwindsor@tresys.com> |
|---|
| r21 |
r38 |
|
| 1 | | .\" Copyright (C) 2006, 2007 Tresys Technology, LLC |
|---|
| | 1 | .\" Copyright (C) 2006 - 2008 Tresys Technology, LLC |
|---|
| 2 | 2 | .\" This file is distributed according to the GNU Lesser General Public License |
|---|
| 3 | 3 | .TH "SIPC_GET_DATA_PTR" 3 "2006-08-10" "Linux 2.6" "Linux Programmer's Manual" |
|---|
| 4 | 4 | .SH NAME |
|---|
| 5 | | sipc_get_data_ptr \- Get a pointer to a secure IPC handle's data. |
|---|
| | 5 | sipc_get_data_ptr \- Get a pointer to a secure IPC handle's sending data buffer |
|---|
| 6 | 6 | .SH "SYNOPSIS" |
|---|
| 7 | 7 | .ad l |
|---|
| … | … | |
| 9 | 9 | #include <sipc/sipc.h> |
|---|
| 10 | 10 | .HP 20 |
|---|
| 11 | | char\ *\fBsipc_get_data_ptr\fR\ (sipc_t\ \fI*sipc\fR); |
|---|
| | 11 | char\ *\fBsipc_get_data_ptr\fR(sipc_t\ \fI*sipc\fR); |
|---|
| 12 | 12 | .ad |
|---|
| 13 | 13 | .hy |
|---|
| 14 | 14 | .SH "DESCRIPTION" |
|---|
| 15 | | \fBsipc_get_data_ptr\fR is used to access the data associated with an |
|---|
| | 15 | \fBsipc_get_data_ptr\fR() is used to access the data associated with an |
|---|
| 16 | 16 | IPC handle. |
|---|
| | 17 | The contents of the pointed to memory will be sent upon a call to |
|---|
| | 18 | \fBsipc_send_data\fR(). |
|---|
| | 19 | .P |
|---|
| | 20 | Do not \fBfree\fR() or otherwise deallocate the returned pointer. |
|---|
| 17 | 21 | .SH "RETURN VALUE" |
|---|
| 18 | | This function returns a pointer to the handle's data member on success, |
|---|
| | 22 | This function returns a pointer to the handle's data member on success, |
|---|
| 19 | 23 | NULL on error. |
|---|
| 20 | 24 | .SH "EXAMPLES" |
|---|
| … | … | |
| 29 | 33 | .fi |
|---|
| 30 | 34 | .SH "SEE ALSO" |
|---|
| 31 | | \fBsipc_init(3)\fR, \fBsipc_disconnect(3)\fR, \fBsipc_send_data(3)\fR, \fBsipc_recv_data(3)\fR, \fBsipc_error(3)\fR |
|---|
| | 35 | \fBsipc_send_data(3)\fR, \fBsipc_recv_data(3)\fR |
|---|
| 32 | 36 | .SH AUTHOR |
|---|
| 33 | 37 | David Windsor <dwindsor@tresys.com> |
|---|
| r21 |
r38 |
|
| 35 | 35 | .TP |
|---|
| 36 | 36 | .I ipc_type |
|---|
| 37 | | The type of IPC to be used for communications, e.g. SIPC_SYSV_MQUEUES |
|---|
| | 37 | The type of IPC to be used for communications, one of SIPC_SYSV_MQUEUES |
|---|
| 38 | 38 | or SIPC_SYSV_SHM. |
|---|
| 39 | 39 | .TP |
|---|
| r21 |
r38 |
|
| 1 | | .\" Copyright (C) 2006, 2007 Tresys Technology, LLC |
|---|
| | 1 | .\" Copyright (C) 2006 - 2008 Tresys Technology, LLC |
|---|
| 2 | 2 | .\" This file is distributed according to the GNU Lesser General Public License |
|---|
| 3 | 3 | .TH "SIPC_RECV_DATA" 3 "2006-08-10" "Linux 2.6" "Linux Programmer's Manual" |
|---|
| 4 | 4 | .SH NAME |
|---|
| 5 | | sipc_recv_data \- Receive data from a secure IPC channel. |
|---|
| | 5 | sipc_recv_data \- Receive data from a secure IPC channel |
|---|
| 6 | 6 | .SH "SYNOPSIS" |
|---|
| 7 | 7 | .ad l |
|---|
| … | … | |
| 9 | 9 | #include <sipc/sipc.h> |
|---|
| 10 | 10 | .HP 20 |
|---|
| 11 | | int\ \fBsipc_recv_data\fR\ (sipc_t\ \fI*sipc\fR, char\ \fI**data\fR, int\ \fI*len\fR); |
|---|
| | 11 | int\ \fBsipc_recv_data\fR(sipc_t\ \fI*sipc\fR, char\ \fI**data\fR, int\ \fI*len\fR); |
|---|
| 12 | 12 | .ad |
|---|
| 13 | 13 | .hy |
|---|
| 14 | 14 | .SH "DESCRIPTION" |
|---|
| 15 | | \fBsipc_recv_data\fR receives data from a secure IPC channel. |
|---|
| | 15 | \fBsipc_recv_data\fR() receives data from a secure IPC channel. |
|---|
| 16 | 16 | .PP |
|---|
| 17 | 17 | The function parameters are as follows: |
|---|
| 18 | 18 | .TP |
|---|
| 19 | 19 | .I sipc |
|---|
| 20 | | An IPC handle |
|---|
| | 20 | An IPC handle |
|---|
| 21 | 21 | .TP |
|---|
| 22 | 22 | .I data |
|---|
| 23 | | Pointer to a buffer which will hold the data received from the channel |
|---|
| | 23 | Pointer to a buffer which will hold the data received from the channel |
|---|
| 24 | 24 | .TP |
|---|
| 25 | 25 | .I len |
|---|
| 26 | 26 | This will hold the total number of bytes received |
|---|
| 27 | 27 | .PP |
|---|
| 28 | | \fBsipc_recv_data\fR allocates the buffer used to store received data. It is |
|---|
| 29 | | the responsibility of the caller to free this data. |
|---|
| | 28 | If the IPC channel is a message queue, \fBsipc_recv_data\fR() |
|---|
| | 29 | allocates the buffer used to store received data; it is the |
|---|
| | 30 | responsibility of the caller to \fBfree()\fR this data afterwards. |
|---|
| | 31 | Otherwise, the shared memory reader must call \fBsipc_shm_recv_done\fR |
|---|
| | 32 | to unblock the sender, and no freeing should occur. |
|---|
| 30 | 33 | .SH "RETURN VALUE" |
|---|
| 31 | 34 | This function returns 0 on success, \-1 on error. |
|---|
| | 35 | Upon error, |
|---|
| | 36 | .I *data |
|---|
| | 37 | will be set to NULL and |
|---|
| | 38 | .I msg_len |
|---|
| | 39 | will be set to zero. |
|---|
| 32 | 40 | .SH "EXAMPLES" |
|---|
| 33 | 41 | .nf |
|---|
| 34 | 42 | /* Sample code */ |
|---|
| 35 | 43 | |
|---|
| 36 | | char *data = sipc_get_data_ptr(ipc); |
|---|
| | 44 | char *data; |
|---|
| | 45 | int len; |
|---|
| 37 | 46 | sipc_recv_data(ipc, &data, &len); |
|---|
| 38 | | printf("Received %s", data); /* Do stuff with shared memory */ |
|---|
| 39 | | sipc_shm_recv_done(ipc); /* When done with the data in shared memory, |
|---|
| 40 | | unblock sender; this is only needed when |
|---|
| 41 | | using shared memory */ |
|---|
| | 47 | printf("Received %s", data); /* Do stuff with shared memory */ |
|---|
| | 48 | sipc_shm_recv_done(ipc); /* Unblock sender when done; this is only |
|---|
| | 49 | needed when using shared memory */ |
|---|
| 42 | 50 | .fi |
|---|
| 43 | 51 | .SH "SEE ALSO" |
|---|
| 44 | | \fBsipc_send_data(3)\fR, \fBsipc_connect(3)\fR, \fBsipc_disconnect(3)\fR, |
|---|
| 45 | | \fBsipc_error(3)\fR |
|---|
| | 52 | \fBsipc_send_data(3)\fR, \fBsipc_shm_recv_done(3)\fR |
|---|
| 46 | 53 | .SH AUTHOR |
|---|
| 47 | 54 | David Windsor <dwindsor@tresys.com> |
|---|
| r21 |
r38 |
|
| 1 | | .\" Copyright (C) 2006, 2007 Tresys Technology, LLC |
|---|
| | 1 | .\" Copyright (C) 2006 - 2008 Tresys Technology, LLC |
|---|
| 2 | 2 | .\" This file is distributed according to the GNU Lesser General Public License |
|---|
| 3 | 3 | .TH "SIPC_SEND_DATA" 3 "2006-08-10" "Linux 2.6" "Linux Programmer's Manual" |
|---|
| 4 | 4 | .SH NAME |
|---|
| 5 | | sipc_send_data \- Send data to a secure IPC channel. |
|---|
| | 5 | sipc_send_data \- Send data to a secure IPC channel |
|---|
| 6 | 6 | .SH "SYNOPSIS" |
|---|
| 7 | 7 | .ad l |
|---|
| … | … | |
| 9 | 9 | #include <sipc/sipc.h> |
|---|
| 10 | 10 | .HP 20 |
|---|
| 11 | | int\ \fBsipc_send_data\fR\ (sipc_t\ \fI*sipc\fR, int\ \fImsg_len\fR); |
|---|
| | 11 | int\ \fBsipc_send_data\fR(sipc_t\ \fI*sipc\fR, int\ \fImsg_len\fR); |
|---|
| 12 | 12 | .ad |
|---|
| 13 | 13 | .hy |
|---|
| … | … | |
| 17 | 17 | the underlying IPC mechanism used, fragmentation of the data may occur |
|---|
| 18 | 18 | during transmission. Reassembly of fragmented data occurs transparently |
|---|
| 19 | | at the receiver's end, with a call to \fBsipc_recv_data\fR. In the case of |
|---|
| 20 | | shared memory, the caller must ensure that the size of the data contained |
|---|
| 21 | | in the handle does not exceed the system shared memory segment size limit, |
|---|
| 22 | | in which case the data will be truncated prior to transmission. |
|---|
| | 19 | at the receiver's end, with a call to \fBsipc_recv_data\fR(). |
|---|
| | 20 | .PP |
|---|
| | 21 | In the case of shared memory, the caller must ensure that the size of |
|---|
| | 22 | the data contained in the handle does not exceed the system shared |
|---|
| | 23 | memory segment size limit, in which case the data will be truncated |
|---|
| | 24 | prior to transmission. Furthermore, this function will block until the |
|---|
| | 25 | message is consumed by the reader (via \fBsipc_recv_data\fR() and |
|---|
| | 26 | \fBsipc_shm_recv_done\fR()). For channels created as message queues, no |
|---|
| | 27 | such blocking occurs. |
|---|
| 23 | 28 | .SH "RETURN VALUE" |
|---|
| 24 | 29 | This function returns 0 on success, \-1 on error. |
|---|
| … | … | |
| 28 | 33 | |
|---|
| 29 | 34 | char msg[] = "Hello, world."; |
|---|
| 30 | | data = sipc_get_data_ptr(ipc); /* Get data pointer from handle */ |
|---|
| | 35 | char *data = sipc_get_data_ptr(ipc); /* Get data pointer from handle */ |
|---|
| 31 | 36 | strncpy(data, msg, size); /* Copy mesasge into the handle */ |
|---|
| 32 | 37 | if (sipc_send_data(ipc, size) < 0) /* Send the message */ |
|---|
| … | … | |
| 34 | 39 | .fi |
|---|
| 35 | 40 | .SH "SEE ALSO" |
|---|
| 36 | | \fBsipc_recv_data(3)\fR, \fBsipc_get_data_ptr(3)\fR, \fBsipc_connect(3)\fR, |
|---|
| 37 | | \fBsipc_disconnect(3)\fR, \fBsipc_error(3)\fR |
|---|
| | 41 | \fBsipc_get_data_ptr(3)\fR, \fBsipc_recv_data(3)\fR |
|---|
| 38 | 42 | .SH AUTHOR |
|---|
| 39 | 43 | David Windsor <dwindsor@tresys.com> |
|---|
| r21 |
r38 |
|
| 1 | | .\" Copyright (C) 2006, 2007 Tresys Technology, LLC |
|---|
| | 1 | .\" Copyright (C) 2006 - 2008 Tresys Technology, LLC |
|---|
| 2 | 2 | .\" This file is distributed according to the GNU Lesser General Public License |
|---|
| 3 | 3 | .TH "SIPC_SHM_RECV_DONE" 3 "2006-08-10" "Linux 2.6" "Linux Programmer's Manual" |
|---|
| … | … | |
| 9 | 9 | #include <sipc/sipc.h> |
|---|
| 10 | 10 | .HP 20 |
|---|
| 11 | | int\ \fBsipc_shm_recv_done\fR\ (sipc_t\ \fI*sipc\fR); |
|---|
| | 11 | int\ \fBsipc_shm_recv_done\fR(sipc_t\ \fI*sipc\fR); |
|---|
| 12 | 12 | .ad |
|---|
| 13 | 13 | .hy |
|---|
| 14 | 14 | .SH "DESCRIPTION" |
|---|
| 15 | | \fBsipc_shm_recv_done\fR is called by an application receiving messages using |
|---|
| 16 | | shared memory during secure IPC. \fBsipc_shm_recv_done\fR unblocks the sending |
|---|
| 17 | | process, allowing it to send more data. This function only needs to be called |
|---|
| 18 | | when using shared memory as a backend for secure IPC. |
|---|
| | 15 | \fBsipc_shm_recv_done\fR() is called by an application receiving |
|---|
| | 16 | messages using shared memory during secure IPC. |
|---|
| | 17 | \fBsipc_shm_recv_done\fR() unblocks the sending process, allowing it |
|---|
| | 18 | to resume processing. |
|---|
| | 19 | This function needs to be called when using shared memory as a backend |
|---|
| | 20 | for secure IPC. |
|---|
| 19 | 21 | .SH "RETURN VALUE" |
|---|
| 20 | 22 | This function returns 0 on success, \-1 on error. |
|---|
| … | … | |
| 23 | 25 | /* Sample code */ |
|---|
| 24 | 26 | |
|---|
| 25 | | char *data = sipc_get_data_ptr(ipc); |
|---|
| | 27 | char *data; |
|---|
| | 28 | int len; |
|---|
| 26 | 29 | sipc_recv_data(ipc, &data, &len); |
|---|
| 27 | 30 | printf("Received %s", data); /* Do stuff with shared memory */ |
|---|
| 28 | | sipc_shm_recv_done(ipc); /* When done with the data in shared memory, |
|---|
| 29 | | unblock sender; this is only needed when |
|---|
| 30 | | using shared memory */ |
|---|
| | 31 | sipc_shm_recv_done(ipc); /* Unblock sender when done; this is only |
|---|
| | 32 | needed when using shared memory */ |
|---|
| 31 | 33 | .fi |
|---|
| 32 | 34 | .SH "SEE ALSO" |
|---|
| 33 | | \fBsipc_send_data(3)\fR, \fBsipc_recv_data(3)\fR, \fBsipc_error(3)\fR |
|---|
| | 35 | \fBsipc_send_data(3)\fR, \fBsipc_recv_data(3)\fR |
|---|
| 34 | 36 | .SH AUTHOR |
|---|
| 35 | 37 | David Windsor <dwindsor@tresys.com> |
|---|
| r21 |
r38 |
|
| 1 | | .\" Copyright (C) 2006, 2007 Tresys Technology, LLC |
|---|
| | 1 | .\" Copyright (C) 2006 - 2008 Tresys Technology, LLC |
|---|
| 2 | 2 | .\" This file is distributed according to the GNU Lesser General Public License |
|---|
| 3 | 3 | .TH "SIPC_UNLINK" 3 "2006-08-10" "Linux 2.6" "Linux Programmer's Manual" |
|---|
| 4 | 4 | .SH NAME |
|---|
| 5 | | sipc_unlink \- Free IPC resources associated with a secure IPC handle |
|---|
| | 5 | sipc_unlink \- Destroy an IPC resource from the system |
|---|
| 6 | 6 | .SH "SYNOPSIS" |
|---|
| 7 | 7 | .ad l |
|---|
| … | … | |
| 18 | 18 | processes actually communicating via secure IPC. |
|---|
| 19 | 19 | Note that even after a call to \fBsipc_unlink\fR(), the IPC resource will |
|---|
| 20 | | continue to exist until all active connections (i.e. sender and receiver) |
|---|
| | 20 | continue to exist until all active connections (i.e., senders and receivers) |
|---|
| 21 | 21 | have called \fBsipc_close\fR(). |
|---|
| 22 | 22 | For this reason, all processes using the IPC resource should call |
|---|
| … | … | |
| 29 | 29 | .TP |
|---|
| 30 | 30 | .I ipc_type |
|---|
| 31 | | One of SIPC_SYSV_MQUEUES or SIPC_SYSV_SHM for message queues |
|---|
| | 31 | One of SIPC_SYSV_MQUEUES or SIPC_SYSV_SHM for message queues |
|---|
| 32 | 32 | or shared memory, respectively. |
|---|
| 33 | 33 | .SH "RETURN VALUE" |
|---|
| 34 | 34 | This function has no return value. |
|---|
| 35 | 35 | .SH "SEE ALSO" |
|---|
| 36 | | \fBsipc_open(3)\fR, \fBsipc_close\fR |
|---|
| | 36 | \fBsipc_open(3)\fR, \fBsipc_close(3)\fR |
|---|
| 37 | 37 | .SH AUTHOR |
|---|
| 38 | 38 | David Windsor <dwindsor@tresys.com> |
|---|
Download in other formats:
* Generating other formats may take time.