Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

rfio_setbufsize(3) [debian man page]

RFIOSETOPT(3)						      Rfio Library Functions						     RFIOSETOPT(3)

NAME
rfiosetopt - set RFIO options SYNOPSIS
#include <sys/types.h> #include "rfio_api.h" int rfiosetopt (int opt, int *pval, int len) int rfio_setbufsize (int s, int bufsize) DESCRIPTION
rfiosetopt sets the RFIO option opt to the content of the memory cell pointed by pval. rfio_setbufsize sets the size of the readahead buffer to be used on a particular socket connection. opt can have on of the following values: RFIO_READOPT The value pointed by pval can be 0, RFIO_READBUF, RFIO_READAHEAD or RFIO_STREAM (V3). If set to zero, a normal read will be used (one request to the server per read). If set to RFIO_READBUF, an internal buffer is allocated in the client API, each call to the server fills this buffer and the user buffer is filled from the internal buffer. There is one server call per buffer fill. If set to RFIO_READAHEAD, an initial call is sent to the server which pushes data to the client buffer until end of file is reached or an error occurs or a new request comes from the client. There is no intermediate buffer unless RFIO_READ- BUF|RFIO_READAHEAD is specified. If RFIO_STREAM is set, the V3 protocol is enabled. This uses 2 socket connections between the client and the server and the server itself is multi-threaded allowing overlap of disk and network operations. The data is pushed on the data socket until end of file is reached or an error occurs. The transfer can be interrupted by sending a packet on the control socket. Default is RFIO_READBUF. The default internal buffer size is 128kB, but the buffer size can be set with an entry RFIO IOBUFSIZE in shift.conf or thru the environment variable RFIO_IOBUFSIZE. RFIO_NETOPT The value pointed by pval can be RFIO_NONET or RFIO_NET. If set to RFIO_NONET, the NET entries in shift.conf are ignored. Default is RFIO_NET. RFIO_NETRETRYOPT The value pointed by pval can be RFIO_RETRYIT or RFIO_NOTIME2RETRY. If set to RFIO_RETRYIT, there will be retries on failing connect. The number of retries is given by the environment variable RFIO_CONRETRY or the RFIO CONRETRY entry in shift.conf. The retry interval (in seconds) is given by the environment variable RFIO_CONRETRYINT or the RFIO CONRETRYINT entry. If set to RFIO_NOTIME2RETRY, there will be no retry on failing connect. Default is RFIO_RETRYIT. RFIO_CONNECTOPT The value pointed by pval can be RFIO_NOLOCAL or RFIO_FORCELOCAL. If set to RFIO_FORCELOCAL, no parsing is done on pathname. The file is assumed to be local. Default is RFIO_NOLOCAL. The len argument is ignored. s is the file descriptor of the receiving socket. bufsize is the size of the readahead buffer to be used. RETURN VALUE
rfiosetopt returns 0 if the operation was successful or -1 if the operation failed. In the latter case, serrno is set appropriately. ERRORS
ENOMEM buffer could not be allocated. EINVAL opt is not a valid option, bufsize is negative or the user tries to change the buffer size after the actual I/O has started. SEE ALSO
rfio_open(3), rfioreadopt(3) AUTHOR
LCG Grid Deployment Team LCG
$Date: 2010-02-15 10:01:40 +0100 (Mon, 15 Feb 2010) $ RFIOSETOPT(3)

Check Out this Related Man Page

RFIO_STAT(3)						      Rfio Library Functions						      RFIO_STAT(3)

NAME
rfio_stat - get information about a file or directory SYNOPSIS
#include <sys/types.h> #include "rfio_api.h" int rfio_stat (const char *path, struct stat *statbuf); int rfio_fstat (int s, struct stat *statbuf); int rfio_lstat (const char *path, struct stat *statbuf); int rfio_mstat (const char *path, struct stat *statbuf); int rfio_mstat_reset (); int rfio_end (); Under Linux, for large files: #define _LARGEFILE64_SOURCE #include <sys/types.h> #include "rfio_api.h" int rfio_stat64 (const char *path, struct stat64 *statbuf); int rfio_fstat64 (int s, struct stat64 *statbuf); int rfio_lstat64 (const char *path, struct stat64 *statbuf); int rfio_mstat64 (const char *path, struct stat64 *statbuf); For large files, under other systems: #include <sys/types.h> #include "rfio_api.h" int rfio_stat64 (const char *path, struct stat64 *statbuf); int rfio_fstat64 (int s, struct stat64 *statbuf); int rfio_lstat64 (const char *path, struct stat64 *statbuf); int rfio_mstat64 (const char *path, struct stat64 *statbuf); DESCRIPTION
rfio_stat gets information about a file or directory. rfio_lstat is identical to rfio_stat except for symbolic links. In this case, the link itself is statted and not followed. rfio_fstat is identical to rfio_stat but works on the file descriptor s returned by rfio_open. rfio_mstat is identical to rfio_stat but keeps the connection open to the server unless there are more than MAXMCON connections already opened. This is useful when issuing a series of stat calls. The last rfio_mstat call should be followed by a call to rfio_end. rfio_mstat_reset is to be used when your program is forking. In such a case the permanent connections opened with rfio_mstat become shared between the parent and the child. Use rfio_mstat_reset to perform the necessary reset and close of the socket file descriptor in the parent or the child in order to be sure that only of them will receice an answer from the RFIO daemon. See NOTES section below. path specifies the logical pathname relative to the current directory or the full pathname. statbuf is a pointer to a stat structure, receiving result of your query. The 64 bits functions must be used for large files. They have the same syntax as the normal stat functions except that they use a stat64 structure. RETURN VALUE
This routine returns 0 if the operation was successful or -1 if the operation failed. In the latter case, serrno is set appropriately. NOTES
Multiple connections using rfio_mstat are thread-safe but not process-wide, therefore a forked child can share file descriptors opened with rfio_mstat by its parent. Use rfio_mstat_reset in such case. Multiple connections behaviour is undefined if you work in a multi-threaded environment and with threads not created using the LCG's Cthread interface. ERRORS
ENOENT The named file/directory does not exist or is a null pathname. EBADF s is not a valid file descriptor. EACCES Search permission is denied on a component of the path prefix. EFAULT path or statbuf is a NULL pointer. ENOTDIR A component of path prefix is not a directory. ENAMETOOLONG The length of path exceeds CA_MAXPATHLEN or the length of a path component exceeds CA_MAXNAMELEN. SENOSHOST Host unknown. SENOSSERV Service unknown. SECOMERR Communication error. SEE ALSO
Castor_limits(4), rfio_chmod(3), rfio_chown(3), Cthread(3) AUTHOR
LCG Grid Deployment Team LCG
$Date: 2005/03/31 13:13:03 $ RFIO_STAT(3)
Man Page