Restrictions for accessing files in bs2fs file systems exist for the following program interfaces:
chmod()
This function is accepted only at file and element level. In all other cases it is rejected with EISDIR
. The S_ISUID
("set user id on execution") and S_ISGID
("set group id on execution") bits are not defined for BS2000 files and library elements and are ignored (if specified in chmod
). The st_ctime field for the file status is not changed; as for BS2000 files, it represents the creation time (cf. fstat).
chown()
, fchown()
The functions are rejected with ENOSYS
if an attempt is made to modify the user and/or group number.
close()
After errors in the case of close() (e.g. with the errno values EIO
, ENOEXEC
, ENOSPC
), the shadow file is retained. With the support of the POSIX administrator it can be used to save the data.
creat(), open()
These functions are accepted only at file and element level. In all other cases they are rejected with EISDIR
. A file or library element cannot be opened in write mode simultaneously in BS2000 and in a bs2fs file system. If a file or a library element in a bs2fs file system is opened in write mode, it cannot be opened in another bs2fs file system. If a file is not generated by the owner (user ID of the file system) but by a process with TSOS privilege, it is nevertheless assigned the uid and gid of the file system's owner. If a file generation group (which is not visible in the bs2fs file system) with the specified file name exists, the call is rejected with ENOSTR
.
A library element may be generated not only by the owner, but also by any user who has write permission and, if necessary, administration permission for the library or type. However, if the user who generates a library element is not the owner, the protection attributes specified in the mode argument are ignored and standard protection attributes are set.
creat(), open() with O_EXCL
If a file which is not visible in the bs2fs file system exists, in other words one with properties which are not supported (STORAGE-LEVEL !=
S0, SUPPORT !=
PUBLIC), the call is rejected with ENXIO
. Nevertheless the file remains invisible (e.g. for the ls command), but "bs2cmd fstat ..." can be used to check whether it exists.
link()
This function is not supported. The call is rejected with ENOSYS
.
mkdir(), rmdir()
These functions are always rejected with ENOSYS
.
open() with O_RDWR under ftyp=text or ftyp=textbin
In the case of text files (ftyp=text or ftyp=textbin) of the type SAM, CRTE in conjunction with SAM forces the existing record structure to be retained because of fopen(...,"r+") in the bs2fs daemon, i.e. in the file area which exists after open() each new line must remain unchanged in the position it occupies and no new line may be inserted. New records can be appended and modified at the end of the existing file.
readlink()
This function is always rejected with ENOSYS
.
remove(), unlink()
These functions are accepted only at file and element level. In all other cases they are rejected with EISDIR
.
rename()
This function is accepted only at file and element level. In all other cases it is rejected with EISDIR
. However, it is possible to convert files to library elements and vice versa, e.g. using the cp or mv command. Library elements of the basic type L cannot, however, be renamed as files or text elements, and files and library elements of the basic types D, J, M, P, S, X cannot be renamed as elements of the basic type L. Renaming an element of the basic type X as a text element (basic type D, J, M, P or S) can corrupt the contents. If the target is simultaneously opened in write mode in BS2000 or another bs2fs file system, rename() is rejected with EAGAIN
.
rmdir()
This function is always rejected with ENOSYS
.
fstat(), stat()
If stat() or fstat() refers to a file in a bs2fs file system, the information supplied depends on whether or not the file is open. If the file is open, the file size precise to the byte is supplied, and the time stamps are supplied precise to the microsecond, as is customary for POSIX files. If the file is not open, stat() supplies the size of the file as specified in BS2000 (i.e. in multiples of 2K blocks), and the time stamps are only precise to the second; the fields with the microsecond details then always
contain 0.
symlink()
This function is always rejected with ENOSYS
.
utime(), utimes()
These functions are accepted only at file and element level. In all other cases they are rejected with EISDIR
. The st_ctime
field for the file status is not changed (cf. chmod). Maintaining the access time stamps (access time st_atime
) of elements is a special library property which can be set with LMS or LMSUP. By default no access time stamps are recorded for elements; stat() then outputs the library's access time stamp. The time at which the time stamps (access time st_atime
, modification time st_mtime
) for directories (root directory of a bs2fs file system, directories at library and type level) are updated is undefined. Only the current time stamp can be set. If the time stamp specified differs from the current time stamp by more than +/-3600 seconds, the call is ignored.