#include <lib/hsm.h>
-#ifdef linux
#include <string.h>
#include <malloc.h>
#include <unistd.h>
-#endif
/*---------------------------------------------------------------------------
#include <lib/hsm.h>
-#ifdef linux
#include <string.h>
#include <getopt.h>
-#endif
/*---------------------------------------------------------------------------
#include <lib/hsm.h>
-#ifdef linux
#include <string.h>
#include <getopt.h>
-#endif
/*---------------------------------------------------------------------------
#include <lib/hsm.h>
-#ifdef linux
#include <string.h>
#include <malloc.h>
#include <getopt.h>
-#endif
/*---------------------------------------------------------------------------
#include <lib/hsm.h>
-#ifdef linux
#include <string.h>
-#endif
/*******************************************************************************
*
#include <lib/hsm.h>
-#ifdef linux
#include <string.h>
+#ifdef linux
#define MAXNAMELEN 256
#endif
#include <lib/hsm.h>
-#ifdef linux
#include <string.h>
#include <time.h>
+#ifdef linux
+#include <stdint.h>
#define S_IAMB (S_IRWXU|S_IRWXG|S_IRWXO)
#endif
if (dmstat->dt_dev != statb.st_dev) {
if (report_errors) {
- fprintf(stdout, "ERROR:dmstat->dt_dev 0x%x, "
- "statb.st_dev 0x%x\n", dmstat->dt_dev,
- statb.st_dev);
+ fprintf(stdout, "ERROR:dmstat->dt_dev 0x%llx, "
+ "statb.st_dev 0x%llx\n",
+ (uint64_t)dmstat->dt_dev,
+ (uint64_t)statb.st_dev);
}
errors++;
}
if (dmstat->dt_ino != statb.st_ino) {
if (report_errors) {
fprintf(stdout, "ERROR:dmstat->dt_ino %llx, "
-#if defined(__sgi) && (_MIPS_SIM != _MIPS_SIM_ABI32)
+#if defined(linux) || (defined(__sgi) && (_MIPS_SIM != _MIPS_SIM_ABI32))
"statb.st_ino %llx\n",
#else
"statb.st_ino %x\n",
}
if (dmstat->dt_rdev != statb.st_rdev) {
if (report_errors) {
- fprintf(stdout, "ERROR:dmstat->dt_rdev 0x%x, "
- "statb.st_rdev 0x%x\n", dmstat->dt_rdev,
- statb.st_rdev);
+ fprintf(stdout, "ERROR:dmstat->dt_rdev 0x%llx, "
+ "statb.st_rdev 0x%llx\n",
+ (uint64_t)dmstat->dt_rdev,
+ (uint64_t)statb.st_rdev);
}
errors++;
}
if (dmstat->dt_size != statb.st_size) {
if (report_errors) {
fprintf(stdout, "ERROR:dmstat->dt_size %lld, "
-#if defined(__sgi) && (_MIPS_SIM != _MIPS_SIM_ABI32)
+#if defined(linux) || (defined(__sgi) && (_MIPS_SIM != _MIPS_SIM_ABI32))
"statb.st_size %lld\n",
#else
"statb.st_size %d\n",
}
if (dmstat->dt_atime != statb.st_atime) {
if (report_errors) {
- fprintf(stdout, "ERROR:dmstat->dt_atime %d, "
- "statb.st_atime %d\n", dmstat->dt_atime,
+ fprintf(stdout, "ERROR:dmstat->dt_atime %ld, "
+ "statb.st_atime %ld\n", dmstat->dt_atime,
statb.st_atime);
}
errors++;
}
if (dmstat->dt_mtime != statb.st_mtime) {
if (report_errors) {
- fprintf(stdout, "ERROR:dmstat->dt_mtime %d, "
- "statb.st_mtime %d\n", dmstat->dt_mtime,
+ fprintf(stdout, "ERROR:dmstat->dt_mtime %ld, "
+ "statb.st_mtime %ld\n", dmstat->dt_mtime,
statb.st_mtime);
}
errors++;
}
if (dmstat->dt_ctime != statb.st_ctime) {
if (report_errors) {
- fprintf(stdout, "ERROR:dmstat->dt_ctime %d, "
- "statb.st_ctime %d\n", dmstat->dt_ctime,
+ fprintf(stdout, "ERROR:dmstat->dt_ctime %ld, "
+ "statb.st_ctime %ld\n", dmstat->dt_ctime,
statb.st_ctime);
}
errors++;
}
if (dmstat->dt_dtime != statb.st_ctime) {
if (report_errors) {
- fprintf(stdout, "ERROR:dmstat->dt_dtime %d, "
- "statb.st_ctime %d\n", dmstat->dt_dtime,
+ fprintf(stdout, "ERROR:dmstat->dt_dtime %ld, "
+ "statb.st_ctime %ld\n", dmstat->dt_dtime,
statb.st_ctime);
}
errors++;
if (dmstat->dt_blksize != statb.st_blksize) {
if (report_errors) {
fprintf(stdout, "ERROR:dmstat->dt_blksize %d, "
- "statb.st_blksize %d\n", dmstat->dt_blksize,
+ "statb.st_blksize %ld\n", dmstat->dt_blksize,
statb.st_blksize);
}
errors++;
if (dmstat->dt_blocks != statb.st_blocks) {
if (report_errors) {
fprintf(stdout, "ERROR:dmstat->dt_blocks %lld, "
-#if defined(__sgi) && (_MIPS_SIM != _MIPS_SIM_ABI32)
+#if defined(linux) || (defined(__sgi) && (_MIPS_SIM != _MIPS_SIM_ABI32))
"statb.st_blocks %lld\n",
#else
"statb.st_blocks %d\n",
{
/* Print all the stat block fields. */
- fprintf(stdout, "dt_dev 0x%x\n", dmstat->dt_dev);
+ fprintf(stdout, "dt_dev 0x%llx\n", (uint64_t)dmstat->dt_dev);
fprintf(stdout, "dt_ino %llx\n", dmstat->dt_ino);
fprintf(stdout, "dt_mode (type) %s\n",
mode_to_string(dmstat->dt_mode));
fprintf(stdout, "dt_nlink %d\n", dmstat->dt_nlink);
fprintf(stdout, "dt_uid %d\n", dmstat->dt_uid);
fprintf(stdout, "dt_gid %d\n", dmstat->dt_gid);
- fprintf(stdout, "dt_rdev 0x%x\n", dmstat->dt_rdev);
+ fprintf(stdout, "dt_rdev 0x%llx\n", (uint64_t)dmstat->dt_rdev);
fprintf(stdout, "dt_size %lld\n", dmstat->dt_size);
fprintf(stdout, "dt_atime %s\n",
print_line(
dm_stat_t *dmstat)
{
- fprintf(stdout, "0x%x|", dmstat->dt_dev);
+ fprintf(stdout, "0x%llx|", (uint64_t)dmstat->dt_dev);
fprintf(stdout, "%llx|", dmstat->dt_ino);
fprintf(stdout, "%s|", mode_to_string(dmstat->dt_mode));
fprintf(stdout, "0%o|", dmstat->dt_mode & S_MASK);
fprintf(stdout, "%d|", dmstat->dt_nlink);
fprintf(stdout, "%d|", dmstat->dt_uid);
fprintf(stdout, "%d|", dmstat->dt_gid);
- fprintf(stdout, "0x%x|", dmstat->dt_rdev);
+ fprintf(stdout, "0x%llx|", (uint64_t)dmstat->dt_rdev);
fprintf(stdout, "%lld|", dmstat->dt_size);
fprintf(stdout, "%s|", date_to_string(dmstat->dt_atime));
fprintf(stdout, "%d|", dmstat->dt_blksize);
fprintf(stdout, "%lld|", dmstat->dt_blocks);
-#ifdef __sgi
fprintf(stdout, "%d|", dmstat->dt_xfs_igen);
fprintf(stdout, "%s|", xflags_to_string(dmstat->dt_xfs_xflags));
fprintf(stdout, "%d|", dmstat->dt_xfs_extsize);
fprintf(stdout, "%d|", dmstat->dt_xfs_extents);
fprintf(stdout, "%d|", dmstat->dt_xfs_aextents);
-#endif
/* Print all other fields. */
#include <lib/hsm.h>
-#ifdef linux
#include <getopt.h>
-#endif
#define NUMLEN 16 /* arbitrary max len of input size */
#define MAX_K (((u_int)LONG_MAX + 1) / 1024)
#include <lib/dmport.h>
-#ifdef linux
#include <string.h>
#include <getopt.h>
-#endif
extern char *optarg;
extern int optind, opterr, optopt;
#include <stdio.h>
#include <stdlib.h>
#include <sys/errno.h>
+#include <getopt.h>
#ifdef linux
#include <dmapi.h>
-#include <getopt.h>
#else
#include <sys/dmi.h>
#endif
#include <stdio.h>
#include <stdlib.h>
#include <sys/errno.h>
+#include <getopt.h>
#ifdef linux
#include <dmapi.h>
-#include <getopt.h>
#else
#include <sys/dmi.h>
#endif
#include <stdio.h>
#include <stdlib.h>
#include <sys/errno.h>
+#include <getopt.h>
#ifdef linux
#include <dmapi.h>
-#include <getopt.h>
#else
#include <sys/dmi.h>
#endif
#include <sys/errno.h>
#include <string.h>
#include <malloc.h>
+#include <getopt.h>
#ifdef linux
#include <dmapi.h>
-#include <getopt.h>
#else
#include <sys/dmi.h>
#endif
#include <stdlib.h>
#include <sys/errno.h>
#include <malloc.h>
+#include <getopt.h>
#ifdef linux
#include <dmapi.h>
-#include <getopt.h>
#else
#include <sys/dmi.h>
#endif
#include <stdlib.h>
#include <stdio.h>
#include <sys/errno.h>
+#include <getopt.h>
#ifdef linux
#include <dmapi.h>
-#include <getopt.h>
#else
#include <sys/dmi.h>
#endif
#include <lib/hsm.h>
-#ifdef linux
#include <string.h>
-#endif
+#include <getopt.h>
/*---------------------------------------------------------------------------
static void
usage(void)
{
- int i;
-
fprintf(stderr, "usage:\t%s [-s sid] string\n", Progname);
exit(1);
}
dm_token_t token;
char *name;
int opt;
- int i;
if (Progname = strrchr(argv[0], '/')) {
Progname++;
#include <lib/hsm.h>
-#ifdef linux
#include <string.h>
-#endif
/*---------------------------------------------------------------------------
char *Progname;
-static void
-usage(void)
-{
- fprintf(stderr, "usage:\t%s pathname\n", Progname);
- exit(1);
-}
-
int
main(
dm_handle_free(fshanp1, fshlen1);
dm_handle_free(fshanp2, fshlen2);
dm_handle_free(fshanp3, fshlen3);
+ exit(0);
}
#include <lib/hsm.h>
-#ifdef linux
#include <string.h>
-#endif
+#include <getopt.h>
/*---------------------------------------------------------------------------
}
dm_handle_free(hanp, hlen);
+ exit(0);
}
#include <lib/dmport.h>
+#include <string.h>
static void
hantoa(
hantoa(hanp, hlen, buffer);
fprintf(stdout, "handle %s, path %s\n", buffer, argv[1]);
+ exit(0);
}
#include <lib/hsm.h>
-#ifdef linux
#include <string.h>
-#endif
/*---------------------------------------------------------------------------
char *type = NULL;
int rc;
-#ifdef __sgi
fprintf(stdout, "%s: starting offset %lld\n", pathname, startoff);
-#else
- fprintf(stdout, "%s: starting offset %d\n", pathname, startoff);
-#endif
/* Allocate space for the number of extents requested by the user. */
}
if (!Dflag) {
-#if __sgi
fprintf(stdout, "\t%d: [%lld..%lld]: %s", num,
-#else
- fprintf(stdout, "\t%d: [%d..%d]: %s", num,
-#endif
extent[i].ex_offset / 512,
(extent[i].ex_offset +
extent[i].ex_length - 1) / 512, type);
if ((extent[i].ex_offset % 512 != 0) ||
(endoff % 512 != 0)) {
-#if __sgi
fprintf(stdout, "\t[%lld..%lld]\n",
-#else
- fprintf(stdout, "\t[%d..%d]\n",
-#endif
extent[i].ex_offset % 512,
(endoff-1) % 512);
} else {
fprintf(stdout, "\n");
}
} else {
-#ifdef __sgi
fprintf(stdout, "%5s %13lld %13lld\n",
-#else
- fprintf(stdout, "%5s %13d %13d\n",
-#endif
type, extent[i].ex_offset,
extent[i].ex_length);
}
*/
if (extent[i].ex_offset != endoff) {
-#ifdef __sgi
fprintf(stderr, "new extent (%lld)is not "
"adjacent to previous one (%lld)\n",
-#else
- fprintf(stderr, "new extent (%d)is not "
- "adjacent to previous one (%d)\n",
-#endif
extent[i].ex_offset, endoff);
return(1);
}
if (num && (extent[i].ex_offset % 512) != 0) {
-#ifdef __sgi
fprintf(stderr, "non-initial ex_offset (%lld) "
-#else
- fprintf(stderr, "non-initial ex_offset (%d) "
-#endif
"is not a 512-byte multiple\n",
extent[i].ex_offset);
return(1);
*/
if (rc && startoff != endoff) {
-#ifdef __sgi
fprintf(stderr, "startoff is %lld, should be %lld\n",
-#else
- fprintf(stderr, "startoff is %d, should be %d\n",
-#endif
startoff, endoff);
return(1);
}
#include <lib/hsm.h>
-#ifdef linux
#include <string.h>
-#endif
+#include <getopt.h>
/*---------------------------------------------------------------------------
#include <lib/hsm.h>
-#ifdef linux
#include <string.h>
-#endif
+#include <getopt.h>
/*---------------------------------------------------------------------------
static void
usage(void)
{
- int i;
-
fprintf(stderr, "usage:\t%s [-b buflen] [-s sid] [-t token] "
"pathname attr\n", Progname);
exit(1);
size_t hlen;
char *name;
int opt;
- int i;
if (Progname = strrchr(argv[0], '/')) {
Progname++;
}
exit(1);
}
- fprintf(stdout, "rlenp is %d, value is '%s'\n", rlenp, bufp);
+ fprintf(stdout, "rlenp is %d, value is '%s'\n", rlenp, (char*)bufp);
dm_handle_free(hanp, hlen);
exit(0);
#include <lib/hsm.h>
-#ifdef linux
#include <string.h>
-#endif
+#include <getopt.h>
/*---------------------------------------------------------------------------
#include <lib/hsm.h>
-#ifdef linux
#include <string.h>
-#endif
+#include <getopt.h>
/*---------------------------------------------------------------------------
static void
usage(void)
{
- int i;
-
fprintf(stderr, "usage:\t%s [-b buflen] [-m maxmsgs] [-f] sid\n",
Progname);
exit(1);
u_int flags = 0;
void *bufp;
size_t buflen = 10000;
- void *hanp;
- size_t hlen;
- char hans1[HANDLE_STR];
u_int maxmsgs = 1;
size_t rlenp;
char *name;
int opt;
- int i;
if (Progname = strrchr(argv[0], '/')) {
Progname++;
#include <lib/hsm.h>
-#ifdef linux
#include <string.h>
-#endif
+#include <getopt.h>
extern int optind;
extern int opterr;
{
dm_sessid_t sid = DM_NO_SESSION;
dm_token_t token = DM_NO_TOKEN;
- char buffer[500];
+/* char buffer[500];*/
void *hanp;
size_t hlen;
dm_stat_t dmstat;
}
XXX Shut off for now. */
}
+ exit(0);
}
#include <sys/param.h>
#include <string.h>
+#include <getopt.h>
#include <lib/hsm.h>
static void
usage(void)
{
- int i;
-
fprintf(stderr, "usage:\t%s [-b buflen] [-s sid] pathname\n",
Progname);
exit(1);
size_t fshlen;
char *name;
int opt;
- int i;
if (Progname = strrchr(argv[0], '/')) {
Progname++;
#include <lib/hsm.h>
-#ifdef linux
#include <string.h>
-#endif
+#include <getopt.h>
/*---------------------------------------------------------------------------
char *Progname;
-static struct {
- char *name;
- int value;
-} rg_events[3] = {
- { "DM_REGION_READ", DM_REGION_READ },
- { "DM_REGION_WRITE", DM_REGION_WRITE },
- { "DM_REGION_TRUNCATE", DM_REGION_TRUNCATE }
-};
-static int nevents = sizeof(rg_events)/sizeof(rg_events[0]);
-
static void
usage(void)
{
- int i;
-
fprintf(stderr, "usage:\t%s [-n nelem] [-s sid] pathname\n", Progname);
exit(1);
}
#include <lib/hsm.h>
-#ifdef linux
#include <string.h>
-#endif
+#include <getopt.h>
/*---------------------------------------------------------------------------
static void
usage(void)
{
- int i;
-
fprintf(stderr, "usage:\t%s [-b buflen] sid\n",
Progname);
exit(1);
size_t rlenp;
char *name;
int opt;
- int i;
if (Progname = strrchr(argv[0], '/')) {
Progname++;
#include <lib/hsm.h>
-#ifdef linux
#include <string.h>
-#endif
+#include <getopt.h>
/*---------------------------------------------------------------------------
static void
usage(void)
{
- int i;
-
fprintf(stderr, "usage:\t%s [-b buflen] [-s sid] pathname\n",
Progname);
exit(1);
size_t hlen;
char *name;
int opt;
- int i;
if (Progname = strrchr(argv[0], '/')) {
Progname++;
#include <lib/hsm.h>
-#ifdef linux
#include <string.h>
-#endif
/*---------------------------------------------------------------------------
#include <lib/dmport.h>
+#include <getopt.h>
+#ifdef linux
+#include <xfs/handle.h>
+#endif
+
/*---------------------------------------------------------------------------
Test program used to test the DMAPI function dm_handle_to_path(). The
}
return(1);
}
- fprintf(stderr, "rlenp is %d, pathbufp is %s\n", rlenp, pathbufp);
+ fprintf(stderr, "rlenp is %d, pathbufp is %s\n", rlenp, (char*)pathbufp);
if (strlen(pathbufp) + 1 != rlenp) {
fprintf(stderr, "rlenp is %d, should be %d\n", rlenp,
strlen(pathbufp) + 1);
return(1);
}
+ exit(0);
}
#include <lib/hsm.h>
-#ifdef linux
#include <string.h>
-#endif
/*---------------------------------------------------------------------------
* http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
*/
+#include <stdlib.h>
#include <lib/dmport.h>
/*
rc = dm_sync_by_handle(sid, hanp, hlen, token);
rc = dm_upgrade_right(sid, hanp, hlen, token);
ssrc = dm_write_invis(sid, hanp, hlen, flags, token, off, len, bufp);
+ exit(0);
}
*/
#include <sys/types.h>
-/* #include <sys/fs/xfs_itable.h> */
-#ifdef linux
-#else
+#ifdef __sgi
+#include <sys/fs/xfs_itable.h>
#include <sys/syssgi.h>
#include <sys/uuid.h>
#include <sys/fs/xfs_fsops.h>
#include <stdio.h>
#include <unistd.h>
+#include <stdlib.h>
+#include <string.h>
static char * prog;
#include <lib/hsm.h>
-#ifdef linux
+#include <getopt.h>
#include <string.h>
-#endif
+
/*---------------------------------------------------------------------------
}
dm_handle_free(hanp, hlen);
+ exit(0);
}
#include <lib/hsm.h>
-#ifdef linux
+#include <getopt.h>
#include <string.h>
-#endif
+
/*---------------------------------------------------------------------------
fprintf(stdout, "there is no hold\n");
}
dm_handle_free(hanp, hlen);
+ exit(0);
}
#include <lib/hsm.h>
-#ifdef linux
+#include <getopt.h>
#include <string.h>
-#endif
+
/*---------------------------------------------------------------------------
}
dm_handle_free(hanp, hlen);
+ exit(0);
}
#include <lib/hsm.h>
-#ifdef linux
#include <string.h>
-#endif
/*---------------------------------------------------------------------------
#include <lib/hsm.h>
-#ifdef linux
#include <string.h>
-#endif
/*---------------------------------------------------------------------------
#include <lib/hsm.h>
-#ifdef linux
#include <string.h>
-#endif
/*---------------------------------------------------------------------------
static void
usage(void)
{
- int i;
-
fprintf(stderr, "usage:\t%s sid token\n",
Progname);
exit(1);
#define HDR "%s: token %d sequence %d\n"
#define VALS "\t%-15s %s\n"
#define VALD "\t%-15s %d\n"
-#ifdef __sgi
#define VALLLD "\t%-15s %lld\n"
-#else
-#define VALLLD "\t%-15s %ld\n"
-#endif
extern int optind;
extern int errno;
#endif
void *hanp1, *hanp2, *namp1, *namp2;
u_int hlen1, hlen2, nlen1, nlen2;
- char hans1[HANDLE_STR], hans2[HANDLE_STR], hans3[HANDLE_STR];
+ char hans1[HANDLE_STR], hans2[HANDLE_STR];
char nams1[MAXNAMELEN], nams2[MAXNAMELEN];
/*
"offset", msg_de->de_offset,
"length", msg_de->de_length);
break;
+ default: break;
}
}
*/
#include <sys/types.h>
-#ifdef linux
-#else
+#include <string.h>
+#ifdef __sgi
#include <sys/syssgi.h>
#include <sys/uuid.h>
#include <sys/fs/xfs_fsops.h>
int argc,
char **argv)
{
-/* xfs_fsop_geom_t geom;*/
+#ifdef __sgi
+ xfs_fsop_geom_t geom;
char *uuid_str;
u_int status;
+#endif
char *name;
int fd;
void *fshanp;
exit(1);
}
-/*
+#ifdef __sgi
syssgi(SGI_XFS_FSOPERATIONS, fd, XFS_FS_GEOMETRY, NULL, &geom);
uuid_to_string(&geom.uuid, &uuid_str, &status);
fprintf(stdout, "fshandle %s, uuid %s, %s\n",
buffer, uuid_str, argv[1]);
-*/
+#endif
fprintf(stdout, "fshandle %s, %s\n",
buffer, argv[1]);
+ exit(0);
}
#include <lib/hsm.h>
-#ifdef linux
+#include <getopt.h>
#include <string.h>
-#endif
+
/*---------------------------------------------------------------------------
static void
usage(void)
{
- int i;
-
fprintf(stderr, "usage:\t%s [-o offset] [-l length] "
"[-s sid] pathname\n", Progname);
exit(1);
size_t hlen;
char *name;
int opt;
- int i;
if (Progname = strrchr(argv[0], '/')) {
Progname++;
#include <lib/hsm.h>
-#ifdef linux
+#include <getopt.h>
#include <string.h>
-#endif
+
/*---------------------------------------------------------------------------
static void
usage(void)
{
- int i;
-
fprintf(stderr, "usage:\t%s [-o offset] [-l length] "
"[-s sid] pathname\n", Progname);
exit(1);
size_t hlen;
char *name;
int opt;
- int i;
if (Progname = strrchr(argv[0], '/')) {
Progname++;
#include <lib/hsm.h>
-#ifdef linux
+#include <getopt.h>
#include <string.h>
-#endif
+
/*---------------------------------------------------------------------------
dm_token_t token;
dm_right_t right;
char *object;
- char *rightstr;
void *hanp;
size_t hlen;
int Fflag = 0;
- int wflag = 0;
char *name;
int opt;
fprintf(stderr, "right is %s\n", rt_value_to_name(right));
dm_handle_free(hanp, hlen);
+ exit(0);
}
fprintf(stderr, "can't unlink %s\n", path);
exit(1);
}
+ exit(0);
}
#include <lib/hsm.h>
-#ifdef linux
+#include <getopt.h>
#include <string.h>
-#endif
+
/*---------------------------------------------------------------------------
}
dm_handle_free(hanp, hlen);
+ exit(0);
}
#include <lib/hsm.h>
-#ifdef linux
+#include <getopt.h>
#include <string.h>
-#endif
+
/*---------------------------------------------------------------------------
static void
usage(void)
{
- int i;
-
fprintf(stderr, "usage:\t%s [-s sid] [-u] pathname attr\n", Progname);
exit(1);
}
size_t hlen;
char *name;
int opt;
- int i;
if (Progname = strrchr(argv[0], '/')) {
Progname++;
#include <lib/hsm.h>
-#ifdef linux
+#include <getopt.h>
#include <string.h>
-#endif
+
/*---------------------------------------------------------------------------
}
dm_handle_free(hanp, hlen);
+ exit(0);
}
#include <lib/hsm.h>
-#ifdef linux
#include <string.h>
-#endif
/*---------------------------------------------------------------------------
static void
usage(void)
{
- int i;
-
fprintf(stderr, "usage:\t%s sid token response reterror\n",
Progname);
exit(1);
#include <strings.h>
#include <unistd.h>
-#ifdef linux
#include <string.h>
-#endif
/*---------------------------------------------------------------------------
static void
usage(void)
{
- int i;
-
fprintf(stderr, "usage:\t%s [-r|-w|-t] [-o offset] [-l length] "
"pathname\n", Progname);
exit(1);
int fd;
ssize_t rc;
int opt;
- int i;
if (Progname = strrchr(argv[0], '/')) {
Progname++;
}
if (seek_off != offset) {
fprintf(stderr,
-#ifdef __sgi
"seeked to offset %lld, actually "
"arrived at %lld\n",
(int64_t)offset, (int64_t)seek_off);
-#else
- "seeked to offset %d, actually "
- "arrived at %d\n",
- offset, seek_off);
-#endif
exit(1);
}
}
#include <stdlib.h>
#include <unistd.h>
-#ifdef linux
#include <string.h>
-#endif
/*
To read unallocated disk blocks in a filesystem, do
#include <lib/hsm.h>
-#ifdef linux
+#include <getopt.h>
#include <string.h>
-#endif
+
/*---------------------------------------------------------------------------
#include <lib/hsm.h>
-#ifdef linux
+#include <getopt.h>
#include <string.h>
-#endif
+
/*---------------------------------------------------------------------------
static void
usage(void)
{
- int i;
-
fprintf(stderr, "usage:\t%s [-b buflen] [-s sid] [-u] pathname "
"attr value\n", Progname);
exit(1);
size_t hlen;
char *name;
int opt;
- int i;
if (Progname = strrchr(argv[0], '/')) {
Progname++;
#include <lib/hsm.h>
-#ifdef linux
+#include <getopt.h>
#include <string.h>
-#endif
+
/*---------------------------------------------------------------------------
u_int maxevent = DM_EVENT_MAX;
char *name;
int opt;
- int i;
if (Progname = strrchr(argv[0], '/')) {
Progname++;
#include <lib/hsm.h>
-#ifdef linux
+#include <getopt.h>
#include <string.h>
-#endif
+
extern int optind;
int daylb;
int dayle;
} daytab[] = {
- 1987, 96, 303, /* new legislation - 1st Sun in April */
- 1976, 119, 303, /* normal Last Sun in Apr - last Sun in Oct */
- 1975, 58, 303, /* 1975: Last Sun in Feb - last Sun in Oct */
- 1974, 5, 333, /* 1974: Jan 6 - last Sun. in Nov */
- 1970, 119, 303, /* start GMT */
+ {1987, 96, 303}, /* new legislation - 1st Sun in April */
+ {1976, 119, 303}, /* normal Last Sun in Apr - last Sun in Oct */
+ {1975, 58, 303}, /* 1975: Last Sun in Feb - last Sun in Oct */
+ {1974, 5, 333}, /* 1974: Jan 6 - last Sun. in Nov */
+ {1970, 119, 303}, /* start GMT */
};
#define DAYTABSIZE (sizeof(daytab)/sizeof(daytab[0]))
char **argv)
{
dm_sessid_t sid = DM_NO_SESSION;
- char buffer[500];
void *hanp;
size_t hlen;
dm_fileattr_t fileattr;
strerror(errno));
exit(1);
}
+ exit(0);
}
S_NEXT(dm_xstat_t, dx_statinfo);
S_NEXT(dm_xstat_t, dx_attrdata);
S_END(dm_xstat_t);
+ exit(0);
}
#include <lib/hsm.h>
-#ifdef linux
+#include <getopt.h>
#include <string.h>
-#endif
+
/*---------------------------------------------------------------------------
static void
usage(void)
{
- int i;
-
fprintf(stderr, "usage:\t%s [-s sid] pathname\n", Progname);
exit(1);
}
size_t hlen;
char *name;
int opt;
- int i;
if (Progname = strrchr(argv[0], '/')) {
Progname++;
exit(1);
}
fprintf(stdout, "SUCCESS!\n");
+ exit(0);
}
#include <lib/hsm.h>
-#ifdef linux
+#include <getopt.h>
#include <string.h>
-#endif
+
/*---------------------------------------------------------------------------
}
dm_handle_free(hanp, hlen);
+ exit(0);
}
else {
printf("ERROR: kernel set_disp call failed: (%d) %s\n",
errno, strerror(errno));
-/* XXX */
-/* exit(1);*/
+ exit(1);
}
}
#define HDR "%s\ntoken :%d\nsequence :%d\n"
#define VALS "%-15s:%s\n"
#define VALD "%-15s:%d\n"
-#ifdef __sgi
#define VALLLD "%-15s:%lld\n"
-#else
-#define VALLLD "%-15s:%ld\n"
-#endif
extern int optind;
extern int errno;
#endif
void *hanp1, *hanp2, *namp1, *namp2;
u_int hlen1, hlen2, nlen1, nlen2;
- char hans1[HANDLE_STR], hans2[HANDLE_STR], hans3[HANDLE_STR];
+ char hans1[HANDLE_STR], hans2[HANDLE_STR];
char nams1[MAXNAMELEN], nams2[MAXNAMELEN];
void *fs_hanp;
size_t fs_hlen;
"offset", msg_de->de_offset,
"length", msg_de->de_length);
break;
+ default: break;
}
}
#include <lib/hsm.h>
#include <lib/errtest.h>
-#ifdef linux
+#include <getopt.h>
#include <string.h>
-#endif
+
/*---------------------------------------------------------------------------
static void
usage(void)
{
- int i;
-
fprintf(stderr, "usage:\t%s [-Rrv] [-l len] [-o offset] [-s sid] ls_path pathname\n",
Progname);
exit(1);
#include <lib/hsm.h>
#include <lib/errtest.h>
-#ifdef linux
+#include <getopt.h>
#include <string.h>
-#endif
+
/*---------------------------------------------------------------------------
static void
usage(void)
{
- int i;
-
fprintf(stderr, "usage:\t%s [-Rv] [-s sid] [-l len] [-o offset] ls_path pathname\n", Progname);
exit(1);
}
#include <lib/dmport.h>
#include <lib/hsm.h>
-#ifdef linux
+#include <getopt.h>
#include <string.h>
-#endif
+
/*---------------------------------------------------------------------------
static void
usage(void)
{
- int i;
-
fprintf(stderr, "usage:\t%s [-a] [-s sid] string\n", Progname);
exit(1);
}
{
dm_sessid_t sid = DM_NO_SESSION;
char *string;
- dm_token_t token;
char *name;
int opt;
- int i;
dm_msgtype_t msgtype = DM_MSGTYPE_SYNC;
if (Progname = strrchr(argv[0], '/')) {
#include <lib/hsm.h>
#include <lib/errtest.h>
-#ifdef linux
+#include <getopt.h>
#include <string.h>
-#endif
+
/*---------------------------------------------------------------------------
Automated test of the DMAPI functions:
static void
usage(void)
{
- int i;
-
fprintf(stderr, "usage:\t%s [-v] [-n number] [-l length] "
"[-s sid] ls_path pathname\n", Progname);
exit(1);
#include <lib/hsm.h>
#include <lib/errtest.h>
-#ifdef linux
+#include <getopt.h>
#include <string.h>
-#endif
+
/*---------------------------------------------------------------------------
Automated search for EFAULT in the following DMAPI commands:
main(int argc, char **argv) {
dm_sessid_t sid = DM_NO_SESSION;
- dm_token_t test_token = DM_NO_TOKEN;
void *hanp;
size_t hlen;
char *name;
char test_file[100];
char command[100];
int opt;
- int i=0;
if (Progname = strrchr(argv[0], '/')) {
Progname++;
{ dm_off_t off=0;
u_int nelem=1;
dm_extent_t extent;
- dm_extent_t *extentp;
u_int nelem_ret;
ERRTEST(EFAULT, "get_allocinfo (bad offp)",
printf("EFAULT testing complete.\n");
+ exit(0);
}
#include <lib/hsm.h>
#include <lib/errtest.h>
-#ifdef linux
+#include <getopt.h>
#include <string.h>
-#endif
+
/*---------------------------------------------------------------------------
static void
usage(void)
{
- int i;
-
fprintf(stderr, "usage:\t%s [-v] [-s sid] [-t token]"
"ls_path directory \n", Progname);
/* fprintf(stderr, "possible events are:\n");
char object[128];
void *hanp;
size_t hlen;
- int Fflag = 0;
int Vflag = 0;
char *name;
int opt;
- dm_eventtype_t event;
int error;
void *fshanp;
size_t fshlen;
#include <unistd.h>
-#ifdef linux
+#include <time.h>
#include <string.h>
-#endif
+
/*---------------------------------------------------------------------------
Automated test of the DMAPI functions:
if (found.dt_mode != expected.dt_mode) {
fprintf(stderr,
"ERROR: get #%d, expected mode %ld, but found %ld\n",
- i, expected.dt_mode, found.dt_mode);
+ i, (long)expected.dt_mode, (long)found.dt_mode);
}
else good++;
if (found.dt_uid != expected.dt_uid) {
fprintf(stderr,
"ERROR: get #%d, expected uid %ld, but found %ld\n",
- i, expected.dt_uid, found.dt_uid);
+ i, (long)expected.dt_uid, (long)found.dt_uid);
}
else good++;
if (found.dt_gid != expected.dt_gid) {
fprintf(stderr,
"ERROR: get #%d, expected gid %ld, but found %ld\n",
- i, expected.dt_gid, found.dt_gid);
+ i, (long)expected.dt_gid, (long)found.dt_gid);
}
else good++;
if (found.dt_atime != expected.dt_atime) {
char *pathname;
char test_file[100];
char command[100];
- int fs_num_files;
int num_files=50;
dm_stat_t *stat_arr;
dm_stat_t dmstat;
void *bufp;
dm_stat_t *statbuf;
int loops=0;
- int all_file_count=0;
void *fs_hanp;
size_t fs_hlen;
void *targhanp;
}
}
/*---------------------------------------------------------*/
- { void *p = (void *)(((char *)bufp)+1);
+ {
if (dm_init_attrloc(sid, hanp, hlen, DM_NO_TOKEN, &loc)){
fprintf(stderr,
"ERROR: dm_init_attrloc failed with %s.\n",
system(command);
}
printf("File attribute tests complete.\n");
+ exit(0);
}
#include <lib/hsm.h>
#include <lib/errtest.h>
-#ifdef linux
+#include <getopt.h>
#include <string.h>
-#endif
+
/*---------------------------------------------------------------------------
static void
usage(void)
{
- int i;
-
fprintf(stderr, "usage:\t%s [-v] [-s sid] ls_path directoryname\n",
Progname);
exit(1);
dm_token_t test_token;
char *name;
int opt;
- int i;
int Vflag = 0;
char filename[128];
char command[128];
/* Check that dm_probe_hole returns an extent from the next
* highest multiple of the block size, to the end of the file
*/
- i = 0;
for (offset = 0; offset < 29604; offset++) {
if (dm_probe_hole(sid, hanp, hlen, DM_NO_TOKEN, offset, length,
&roff, &rlen)) {
#include <lib/hsm.h>
#include <lib/errtest.h>
-#ifdef linux
+#include <getopt.h>
#include <string.h>
-#endif
+#include <time.h>
/*---------------------------------------------------------------------------
static void
usage(void)
{
- int i;
-
fprintf(stderr, "usage:\t%s [-v] [-s sid] ls_path pathname\n",
Progname);
exit(1);
#include <lib/hsm.h>
#include <lib/errtest.h>
-#ifdef linux
+#include <getopt.h>
#include <string.h>
-#endif
+
/*---------------------------------------------------------------------------
char *Progname;
-static struct {
- char *name;
- int value;
-} rg_events[3] = {
- { "DM_REGION_READ", DM_REGION_READ },
- { "DM_REGION_WRITE", DM_REGION_WRITE },
- { "DM_REGION_TRUNCATE", DM_REGION_TRUNCATE }
-};
u_int reg_flags[8] = {DM_REGION_NOEVENT,
DM_REGION_READ,
DM_REGION_READ | DM_REGION_WRITE | DM_REGION_TRUNCATE};
-static int nevents = sizeof(rg_events)/sizeof(rg_events[0]);
-
static void
usage(void)
{
- int i;
-
fprintf(stderr, "usage:\t%s [-s sid] ls_path pathname\n", Progname);
exit(1);
}
#include <lib/hsm.h>
#include <lib/errtest.h>
-#ifdef linux
+#include <getopt.h>
#include <string.h>
-#endif
+
/*---------------------------------------------------------------------------
Automated test of access rights, involving many DMAPI functions
char command[150];
int opt;
int i=0;
- int error_count=0;
if (Progname = strrchr(argv[0], '/')) {
Progname++;
printf("Access rights testing complete.\n");
+ exit(0);
}