NAME

mkfs - make a file system on a device

SYNOPSIS

#include <sys/types.h>
#include <fsys.h>

int mkfs(char *servername, int devnum, uint_32 disksize,int nfiles);

DESCRIPTION

mkfs() makes a file system on the device specified by devnum using the server servername. disksize is specified in bytes and the number of total files is specified by nfiles. devnum refers to the entry in the device number table in the upper 8 bits with a minor device number specified in the lower 8 bits. mkfs is processed by the main fsys thread and other threads may not have access to the device when the file system is being made. All files must be closed and synchronized.

RETURN VALUES

Upon successful completion, zero is returned. If an error has occurred, the return value is -1 and errno is set.

ERRORS

This function is a member of Unison's IOLIB family of functions. IOLIB is implemented as a message passing and generalized interface layer. Each Unison I/O server is responsible for its own error reporting.

For an exact list of error codes returned by a particular server, refer to that server's documentation in the Unison Programmer's Guide for each specific platform.

Servers may implement these errors codes in response to this function.

mkfs() fails and the errno is set as follows:

ENOSPC
There is no space or not enough space on the media.
ENODEV
devnum is not valid.
ENOMEM
There is not enough memory to allocate sufficient buffers for the file system.
EBUSY
The device is busy and has been locked by another file system clone.

SEE ALSO

mount(), unmount(),



< Copyright Rowebots Research Inc. and Multiprocessor Toolsmiths Inc. 1987-2011 >