next up previous contents
Next: 4.5.2 State Functions Up: 4.5 FiST Vnode Functions Previous: 4.5 FiST Vnode Functions

   
4.5.1 Errors

I chose to treat error codes as just another type of data. Error codes are usually a short integer: zero indicates no error, and a positive integer indicates one of many possible errno numbers. The directive %error returns the error code for the last function executed.

FiST can be instructed to return any error code which exists in <sys/errno.h> or even new error codes. New error codes would be suitable for new types of failure modes. For example, an encryption file system might have a new error code ``invalid key;'' a compression file system might have a code indicating ``file already compressed;'' a caching file system might have a code for ``cached file is too old,'' and so on.



Erez Zadok
1999-12-07