#include <sys/types.h>
#include <sys/stat.h>
#include <Qlg.h>
int QlgMkfifo(const Qlg_Path_Name_T *path,
mode_t mode);
Service Program Name: QP0LLIB1The QlgMkfifo() function, like the mkfifo() function, creates a new FIFO special file whose name is defined by path. The difference is that the QlgMkfifo() function takes a pointer to a Qlg_Path_Name_T structure, while mkfifo() takes a pointer to a character string.
Limited information on the path parameter is provided here. For more information on the path parameter and for a discussion of other parameters, authorities required, return values, and related information, see mkfifo()--Make FIFO Special File.
See Code disclaimer information for information pertaining to code examples.
The following example creates a new FIFO:
#include <sys/stat.h>
#include <stdio.h>
#include <string.h>
#include <Qlg.h>
void main()
{
typedef struct pnstruct
{
Qlg_Path_Name_T qlg_struct;
char[100] pn; /* This size must be >= the path */
/* name length or a pointer to */
/* the path name. */
};
struct pnstruct path;
char *mypath = "/newFIFO";
/**************************************************************/
/* Initialize Qlg_Path_Name_T structure. */
/**************************************************************/
memset((void*)path name, 0x00, sizeof(struct pnstruct));
path.qlg_struct.CCSID = 37;
memcpy(path.qlg_struct.Country_ID, "US", 2);
memcpy(path.qlg_struct.Language_ID, "ENU", 3);
path.qlg_struct.Path_Type = QLG_CHAR_SINGLE;
path.qlg_struct.Path_Length = strlen(mypath);
path.qlg_struct.Path_Name_Delimiter = '/';
memcpy(path.pn, mypath, strlen(mypath));
if (QlgMkfifo((Qlg_Path_Name_T *)path name,
S_IRWXU|S_IRWXO) != 0)
perror("QlgMkfifo() error");
else
puts("success!");
return;
}
| Top | UNIX-Type APIs | APIs by category |