~ubuntu-branches/ubuntu/vivid/cctools/vivid

« back to all changes in this revision

Viewing changes to parrot/src/pfs_types.h

  • Committer: Bazaar Package Importer
  • Author(s): Michael Hanke
  • Date: 2011-05-07 09:05:00 UTC
  • Revision ID: james.westby@ubuntu.com-20110507090500-lqpmdtwndor6e7os
Tags: upstream-3.3.2
ImportĀ upstreamĀ versionĀ 3.3.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
Copyright (C) 2003-2004 Douglas Thain and the University of Wisconsin
 
3
Copyright (C) 2005- The University of Notre Dame
 
4
This software is distributed under the GNU General Public License.
 
5
See the file COPYING for details.
 
6
*/
 
7
 
 
8
#ifndef PFS_TYPES_H
 
9
#define PFS_TYPES_H
 
10
 
 
11
#include "int_sizes.h"
 
12
 
 
13
#include <sys/wait.h>
 
14
#include <sys/types.h>
 
15
#include <sys/socket.h>
 
16
#include <sys/uio.h>
 
17
#include <dirent.h>
 
18
#include <sys/stat.h>
 
19
 
 
20
#define PFS_PATH_MAX 1024
 
21
#define PFS_LINE_MAX 1024
 
22
#define PFS_ARG_MAX  1024
 
23
 
 
24
typedef INT64_T pfs_ssize_t;
 
25
typedef INT64_T pfs_size_t;
 
26
typedef INT64_T pfs_off_t;
 
27
 
 
28
struct pfs_stat {
 
29
        INT64_T st_dev;
 
30
        INT64_T st_ino;
 
31
        INT64_T st_mode;
 
32
        INT64_T st_nlink;
 
33
        INT64_T st_uid;
 
34
        INT64_T st_gid;
 
35
        INT64_T st_rdev;
 
36
        INT64_T st_size;
 
37
        INT64_T st_blksize;
 
38
        INT64_T st_blocks;
 
39
#if !defined(st_atime)
 
40
        INT64_T st_atime;
 
41
        INT64_T st_mtime;
 
42
        INT64_T st_ctime;
 
43
#else
 
44
        struct timespec st_atim;
 
45
        struct timespec st_mtim;
 
46
        struct timespec st_ctim;
 
47
#endif
 
48
};
 
49
 
 
50
struct pfs_statfs {
 
51
        INT64_T f_type;
 
52
        INT64_T f_blocks;
 
53
        INT64_T f_bavail;
 
54
        INT64_T f_bsize;
 
55
        INT64_T f_bfree;
 
56
        INT64_T f_files;
 
57
        INT64_T f_ffree;
 
58
};
 
59
 
 
60
extern uid_t pfs_uid;
 
61
extern gid_t pfs_gid;
 
62
 
 
63
#ifndef COPY_STAT
 
64
#define COPY_STAT( a, b )\
 
65
        memset(&(b),0,sizeof(b));\
 
66
        (b).st_dev = (a).st_dev;\
 
67
        (b).st_ino = (a).st_ino;\
 
68
        (b).st_mode = (a).st_mode;\
 
69
        (b).st_nlink = (a).st_nlink;\
 
70
        (b).st_uid = (a).st_uid;\
 
71
        (b).st_gid = (a).st_gid;\
 
72
        (b).st_rdev = (a).st_rdev;\
 
73
        (b).st_size = (a).st_size;\
 
74
        (b).st_blksize = (a).st_blksize;\
 
75
        (b).st_blocks = (a).st_blocks;\
 
76
        (b).st_atime = (a).st_atime;\
 
77
        (b).st_mtime = (a).st_mtime;\
 
78
        (b).st_ctime = (a).st_ctime;
 
79
#endif
 
80
 
 
81
#ifndef COPY_CSTAT
 
82
#define COPY_CSTAT( a, b )\
 
83
        memset(&(b),0,sizeof(b));\
 
84
        (b).st_dev = (a).cst_dev;\
 
85
        (b).st_ino = (a).cst_ino;\
 
86
        (b).st_mode = (a).cst_mode;\
 
87
        (b).st_nlink = (a).cst_nlink;\
 
88
        (b).st_uid = pfs_uid;\
 
89
        (b).st_gid = pfs_gid;\
 
90
        (b).st_rdev = (a).cst_rdev;\
 
91
        (b).st_size = (a).cst_size;\
 
92
        (b).st_blksize = (a).cst_blksize;\
 
93
        (b).st_blocks = (a).cst_blocks;\
 
94
        (b).st_atime = (a).cst_atime;\
 
95
        (b).st_mtime = (a).cst_mtime;\
 
96
        (b).st_ctime = (a).cst_ctime;
 
97
#endif
 
98
 
 
99
#ifndef COPY_STATFS
 
100
#define COPY_STATFS( a, b )\
 
101
        memset(&(b),0,sizeof(b));\
 
102
        (b).f_type = (a).f_type;\
 
103
        (b).f_blocks = (a).f_blocks;\
 
104
        (b).f_bavail = (a).f_bavail;\
 
105
        (b).f_bsize = (a).f_bsize;\
 
106
        (b).f_bfree = (a).f_bfree;\
 
107
        (b).f_files = (a).f_files;\
 
108
        (b).f_ffree = (a).f_ffree;
 
109
#endif
 
110
 
 
111
#endif