26.02.2014 Views

Getting Started with QNX Neutrino - QNX Software Systems

Getting Started with QNX Neutrino - QNX Software Systems

Getting Started with QNX Neutrino - QNX Software Systems

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Writing a resource manager<br />

© 2009, <strong>QNX</strong> <strong>Software</strong> <strong>Systems</strong> GmbH & Co. KG.<br />

mode<br />

nlink<br />

File’s mode. These are the standard S_* values from ,<br />

such as S_IFCHR, or in octal representation, such as 0664 to indicate<br />

read/write permission for owner and group, and read-only permission<br />

for other.<br />

Number of links to the file, returned by the client’s stat() function call.<br />

rdev<br />

For a character special device, this field consists of a major and minor<br />

device code (10 bits minor in the least-significant positions; next 6<br />

bits are the major device number). For other types of devices,<br />

contains the device number. (See below in “Of device numbers,<br />

inodes, and our friend rdev,” for more discussion.)<br />

The iofunc_mount_t mount structure<br />

As <strong>with</strong> the OCB, you can extend the “normal” attributes structure <strong>with</strong> your own<br />

data. See the “Advanced topics” section.<br />

The mount structure contains information that’s common across multiple attributes<br />

structures.<br />

Here are the contents of the mount structure (from ):<br />

typedef struct _iofunc_mount {<br />

uint32_t flags;<br />

uint32_t conf ;<br />

dev_t<br />

dev;<br />

int32_t blocksize;<br />

iofunc_funcs_t *funcs;<br />

} iofunc_mount_t;<br />

The flags member contains just one flag, IOFUNC_MOUNT_32BIT. This flag indicates<br />

that offset in the OCB, and nbytes and inode in the attributes structure, are 32-bit. Note<br />

that you can define your own flags in flags, using any of the bits from the constant<br />

IOFUNC_MOUNT_FLAGS_PRIVATE.<br />

The conf member contains the following flags:<br />

IOFUNC_PC_CHOWN_RESTRICTED<br />

Indicates if the filesystem is operating in a “chown-restricted” manner, meaning<br />

if only root is allowed to chown a file.<br />

IOFUNC_PC_NO_TRUNC<br />

Indicates that the filesystem doesn’t truncate the name.<br />

IOFUNC_PC_SYNC_IO<br />

Indicates that the filesystem supports synchronous I/O operations.<br />

IOFUNC_PC_LINK_DIR<br />

Indicates that linking/unlinking of directories is allowed.<br />

224 Chapter 5 • Resource Managers April 30, 2009

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!