]>
git.ipfire.org Git - thirdparty/xfsprogs-dev.git/blob - libxfs/irix.c
2 * Copyright (c) 2000-2003,2005 Silicon Graphics, Inc.
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License as
7 * published by the Free Software Foundation.
9 * This program is distributed in the hope that it would be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write the Free Software Foundation,
16 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
21 #include <sys/sysmp.h>
23 int platform_has_uuid
= 0;
24 extern char *progname
;
25 extern __int64_t
findsize(char *);
28 platform_check_ismounted(char *name
, char *block
, struct stat64
*s
, int verbose
)
34 platform_check_iswritable(char *name
, char *block
, struct stat64
*s
, int fatal
)
40 platform_set_blocksize(int fd
, char *path
, dev_t device
, int blocksize
, int fatal
)
46 platform_flush_device(int fd
, dev_t device
)
52 platform_findsizes(char *path
, int fd
, long long *sz
, int *bsz
)
56 if (fstat64(fd
, &st
) < 0) {
58 _("%s: cannot stat the device file \"%s\": %s\n"),
59 progname
, path
, strerror(errno
));
62 if ((st
.st_mode
& S_IFMT
) == S_IFREG
) {
63 *sz
= (long long)(st
.st_size
>> 9);
71 platform_findrawpath(char *path
)
73 return findrawpath(path
);
77 platform_findblockpath(char *path
)
79 return findblockpath(path
);
83 platform_direct_blockdev(void)
89 platform_align_blockdev(void)
91 return sizeof(void *);
97 return sysmp(MP_NPROCS
);
101 platform_physmem(void)
105 if (sysmp(MP_SAGET
, MPSA_RMINFO
, &ri
, sizeof(ri
)) < 0)
106 fprintf(stderr
, _("%s: can't determine memory size\n"),
110 return (ri
.physmem
>> 10) * getpagesize(); /* kilobytes */