1 /*
   2  * This file and its contents are supplied under the terms of the
   3  * Common Development and Distribution License ("CDDL"), version 1.0.
   4  * You may only use this file in accordance with the terms of version
   5  * 1.0 of the CDDL.
   6  *
   7  * A full copy of the text of the CDDL should have accompanied this
   8  * source.  A copy of the CDDL is also available via the Internet at
   9  * http://www.illumos.org/license/CDDL.
  10  */
  11 
  12 /*
  13  * Copyright 2013 Damian Bogel. All rights reserved.
  14  */
  15 
  16 #ifndef _LIBFSD_H
  17 #define _LIBFSD_H
  18 
  19 #include <sys/fsd.h>
  20 
  21 #ifdef __cplusplus
  22 extern "C" {
  23 #endif
  24 
  25 extern __thread int fsd_errno;
  26 
  27 #define EFSD_NOERROR                    0
  28 #define EFSD_BAD_STAT                   1
  29 #define EFSD_INTERNAL                   2
  30 #define EFSD_CANT_OPEN_DRIVER           3
  31 #define EFSD_CANT_OPEN_MOUNTPOINT       4
  32 #define EFSD_ENTRY_NOT_FOUND            5
  33 #define EFSD_FAULT                      6
  34 #define EFSD_UNKNOWN_ERROR              7
  35 
  36 extern const char *fsd_strerr(int e);
  37 
  38 extern int fsd_open();
  39 extern void fsd_close(int fd);
  40 
  41 extern int fsd_enable(int fd);
  42 extern int fsd_disable(int fd);
  43 
  44 extern int fsd_disturb(int fd, const char *mntpt_path, fsd_stat_t *stat);
  45 extern int fsd_disturb_off(int fd, const char *mntpt_path);
  46 
  47 extern int fsd_newdisturb(int fd, fsd_stat_t *stat);
  48 extern int fsd_newdisturb_off(int fd);
  49 
  50 #ifdef __cplusplus
  51 }
  52 #endif
  53 
  54 #endif /* _LIBFSD_H */