The goal of this assignment is to try out the approaches and tools discussed in class on a real-world
example: a subsystem of an existing code base of the Linux system that is related to les managed by
Logical Schema Description
The logical predicate in the schema is the
file(fileid; fname; size; permissions; user; group)
table that is then specialized to
tables, each containing les of the appropriate type. As an initial variant of fileid one can consider the
path from the root of the lesystems (\/”). One can assume that the above tables are paiwise disjoint,
but there could be les not belonging to any of these tabls. An alternative (more ecient) variants will
be discussed below.
Physical Schema Description
The physical predicates (access paths) consist of the following system calls:
int open(const char *pathname, int flags, mode t mode)
int fstat(int fd, struct stat *statbuf)
ssize t readlinkat(int dirfd, const char *pathname, char *buf, size t bufsiz)
struct dirent *readdir(DIR *dirp)
DIR *fdopendir(int fd)
These syscalls will correspond to access paths in your physical design, perhaps with appropriate binding
pattern annotations. For example, the int open(const char *pathname, int flags, mode t mode)
call will (likely) yield an access path
a relation that contains pairs paths and (open) le descriptors.
Detailed descriptions of these syscalls and their parameters are available in the Linux man pages. One
can, in addition, assume the presence of access paths that manipulate strings (such as string concatena-
tion), and access paths that dereference pointers and extract elds from structs as discussed in class.
You are also welcome to explore other Unix/Linux syscalls if you nd that advantageous (but you will
need to document/explain why you have chosen them).
Your task is twofold:
1. rst, dene a logical and physical schema (as a set of constraints) that captures the above situation;
this includes specifying the appropriate binding patterns for the physicel design (such as \one can
only dereference a pointer to a value when given such a pointer as an input parameter”); The
2. second, describe the C code that will accompany the access paths derived from the above system calls:
this can be done either informally (as a pseudocode) or as a C source (in terms of get first xxx()
and get next xxx() iterators and perhaps initialization code).
The constraints in your design should capture the modelled situation as closely as possible, in particular,
you want to think where keys and functional constraints are appropriate/needed (for example when elds
are extracted from the structs).
本网站支持淘宝 支付宝 微信支付 paypal等等交易。如果不放心可以用淘宝交易！
E-mail: email@example.com 微信:itcsdx