]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
Remove use of LFS64 interfaces
authorViolet Purcell <vimproved@inventati.org>
Mon, 5 Feb 2024 23:23:19 +0000 (23:23 +0000)
committerCarlos Maiolino <cem@kernel.org>
Fri, 16 Feb 2024 13:47:33 +0000 (14:47 +0100)
LFS64 interfaces are non-standard and are being removed in the upcoming musl
1.2.5. Setting _FILE_OFFSET_BITS=64 (which is currently being done) makes all
interfaces on glibc 64-bit by default, so using the LFS64 interfaces is
redundant. This commit replaces all occurences of off64_t with off_t,
stat64 with stat, and fstat64 with fstat.

Link: https://bugs.gentoo.org/907039
Cc: Felix Janda <felix.janda@posteo.de>
Reviewed-by: "Darrick J. Wong" <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Violet Purcell <vimproved@inventati.org>
Signed-off-by: Sam James <sam@gentoo.org>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
26 files changed:
copy/xfs_copy.c
fsr/xfs_fsr.c
io/bmap.c
io/copy_file_range.c
io/cowextsize.c
io/fadvise.c
io/fiemap.c
io/fsmap.c
io/io.h
io/madvise.c
io/mincore.c
io/mmap.c
io/pread.c
io/pwrite.c
io/reflink.c
io/seek.c
io/sendfile.c
io/stat.c
io/sync_file_range.c
io/truncate.c
libxfs/rdwr.c
mdrestore/xfs_mdrestore.c
repair/prefetch.c
scrub/spacemap.c
spaceman/freesp.c
spaceman/trim.c

index 0420649de9dc59f608e30f98ea5b3cf61fd3ca00..98a578a017c645184bf855758907b6a718ea08b4 100644 (file)
@@ -881,7 +881,7 @@ main(int argc, char **argv)
                        }
                } else  {
                        char    *lb = memalign(wbuf_align, XFS_MAX_SECTORSIZE);
-                       off64_t off;
+                       off_t   off;
                        ssize_t len;
 
                        /* ensure device files are sufficiently large */
index ba02506d8e477d4805f8680677775ad056864f36..12fffbd81f5878e5b28ec7d15d76d0be7d8f2c22 100644 (file)
@@ -1148,7 +1148,7 @@ packfile(char *fname, char *tname, int fd,
        struct dioattr  dio;
        static xfs_swapext_t   sx;
        struct xfs_flock64  space;
-       off64_t         cnt, pos;
+       off_t   cnt, pos;
        void            *fbuf = NULL;
        int             ct, wc, wc_b4;
        char            ffname[SMBUFSZ];
index 722a389baaa4d8e74009efc29ffaee9ddfe12941..6182e1c591da18b30ab7a8143ef2a77c555a626f 100644 (file)
--- a/io/bmap.c
+++ b/io/bmap.c
@@ -257,7 +257,7 @@ bmap_f(
 #define        FLG_BSW         0000010 /* Not on begin of stripe width */
 #define        FLG_ESW         0000001 /* Not on end   of stripe width */
                int     agno;
-               off64_t agoff, bbperag;
+               off_t agoff, bbperag;
                int     foff_w, boff_w, aoff_w, tot_w, agno_w;
                char    rbuf[32], bbuf[32], abuf[32];
                int     sunit, swidth;
@@ -267,8 +267,8 @@ bmap_f(
                if (is_rt)
                        sunit = swidth = bbperag = 0;
                else {
-                       bbperag = (off64_t)fsgeo.agblocks *
-                                 (off64_t)fsgeo.blocksize / BBSIZE;
+                       bbperag = (off_t)fsgeo.agblocks *
+                                 (off_t)fsgeo.blocksize / BBSIZE;
                        sunit = (fsgeo.sunit * fsgeo.blocksize) / BBSIZE;
                        swidth = (fsgeo.swidth * fsgeo.blocksize) / BBSIZE;
                }
index d154fa7657898148165877bace2b1be292556a94..422e691a99f9595e0fdf9fb67a18ddc7c0cfcba5 100644 (file)
@@ -54,7 +54,7 @@ copy_file_range_cmd(int fd, long long *src_off, long long *dst_off, size_t len)
        return 0;
 }
 
-static off64_t
+static off_t
 copy_src_filesize(int fd)
 {
        struct stat st;
@@ -154,7 +154,7 @@ copy_range_f(int argc, char **argv)
        }
 
        if (!len_specified) {
-               off64_t sz;
+               off_t   sz;
 
                sz = copy_src_filesize(fd);
                if (sz < 0 || (unsigned long long)sz > SIZE_MAX) {
index f6b134df37729adbc2237e14c91897369a6021b0..00e40c6fd68ad6ac1ba3218a29e08d8897aa3548 100644 (file)
@@ -50,10 +50,10 @@ static int
 set_cowextsize(const char *path, int fd, long extsz)
 {
        struct fsxattr  fsx;
-       struct stat64   stat;
+       struct stat     stat;
 
-       if (fstat64(fd, &stat) < 0) {
-               perror("fstat64");
+       if (fstat(fd, &stat) < 0) {
+               perror("fstat");
                exitcode = 1;
                return 0;
        }
index 60cc0f0884652c61beaca40a24abd41d56624652..0966c41bcf8c6ce02fb733db56dc4f9ed5662708 100644 (file)
@@ -39,7 +39,7 @@ fadvise_f(
        int             argc,
        char            **argv)
 {
-       off64_t         offset = 0, length = 0;
+       off_t           offset = 0, length = 0;
        int             c, range = 0, advise = POSIX_FADV_NORMAL;
 
        while ((c = getopt(argc, argv, "dnrsw")) != EOF) {
index f0c74dfe606db8c95269ed26e583fbc1b213bfab..b41f71bfd027bbb14e470d892e1f0685a2e0bd86 100644 (file)
@@ -234,9 +234,9 @@ fiemap_f(
        int             tot_w = 5;      /* 5 since its just one number */
        int             flg_w = 5;
        __u64           last_logical = 0;       /* last extent offset handled */
-       off64_t         start_offset = 0;       /* mapping start */
-       off64_t         length = -1LL;          /* mapping length */
-       off64_t         range_end = -1LL;       /* mapping end*/
+       off_t           start_offset = 0;       /* mapping start */
+       off_t           length = -1LL;          /* mapping length */
+       off_t           range_end = -1LL;       /* mapping end*/
        size_t          fsblocksize, fssectsize;
        struct stat     st;
 
index 7db51847e2b93e4dee40de34fde060d211f63634..bf1196390cf35d066b5ca4df3aecf4ff491915b1 100644 (file)
@@ -170,7 +170,7 @@ dump_map_verbose(
        unsigned long long      i;
        struct fsmap            *p;
        int                     agno;
-       off64_t                 agoff, bperag;
+       off_t                   agoff, bperag;
        int                     foff_w, boff_w, aoff_w, tot_w, agno_w, own_w;
        int                     nr_w, dev_w;
        char                    rbuf[40], bbuf[40], abuf[40], obuf[40];
@@ -183,8 +183,8 @@ dump_map_verbose(
        dev_w = 3;
        nr_w = 4;
        tot_w = MINTOT_WIDTH;
-       bperag = (off64_t)fsgeo->agblocks *
-                 (off64_t)fsgeo->blocksize;
+       bperag = (off_t)fsgeo->agblocks *
+                 (off_t)fsgeo->blocksize;
        sunit = (fsgeo->sunit * fsgeo->blocksize);
        swidth = (fsgeo->swidth * fsgeo->blocksize);
 
diff --git a/io/io.h b/io/io.h
index fe474faf4ad0988e71e2551d106908e7ff1fe25e..68e5e4871af70e26e9fd9a6bea0844041ddc996c 100644 (file)
--- a/io/io.h
+++ b/io/io.h
@@ -53,7 +53,7 @@ extern int stat_f(int argc, char **argv);
 typedef struct mmap_region {
        void            *addr;          /* address of start of mapping */
        size_t          length;         /* length of mapping */
-       off64_t         offset;         /* start offset into backing file */
+       off_t           offset;         /* start offset into backing file */
        int             prot;           /* protection mode of the mapping */
        int             flags;          /* MAP_* flags passed to mmap() */
        char            *name;          /* name of backing file */
@@ -63,13 +63,13 @@ extern mmap_region_t        *maptable;      /* mmap'd region array */
 extern int             mapcount;       /* #entries in the mapping table */
 extern mmap_region_t   *mapping;       /* active mapping table entry */
 extern int maplist_f(void);
-extern void *check_mapping_range(mmap_region_t *, off64_t, size_t, int);
+extern void *check_mapping_range(mmap_region_t *, off_t, size_t, int);
 
 /*
  * Various xfs_io helper routines/globals
  */
 
-extern off64_t         filesize(void);
+extern off_t           filesize(void);
 extern int             openfile(char *, struct xfs_fsop_geom *, int, mode_t,
                                 struct fs_path *);
 extern int             addfile(char *, int , struct xfs_fsop_geom *, int,
@@ -84,9 +84,9 @@ extern size_t         io_buffersize;
 extern int             vectors;
 extern struct iovec    *iov;
 extern int             alloc_buffer(size_t, int, unsigned int);
-extern int             read_buffer(int, off64_t, long long, long long *,
+extern int             read_buffer(int, off_t, long long, long long *,
                                        int, int);
-extern void            dump_buffer(off64_t, ssize_t);
+extern void            dump_buffer(off_t, ssize_t);
 
 extern void            attr_init(void);
 extern void            bmap_init(void);
index bde31539b606b88542c122749b10985aeb0b501b..6e9c5b121d728913f83321c743126b567c2f3021 100644 (file)
@@ -39,7 +39,7 @@ madvise_f(
        int             argc,
        char            **argv)
 {
-       off64_t         offset, llength;
+       off_t           offset, llength;
        size_t          length;
        void            *start;
        int             advise = MADV_NORMAL, c;
index 67f1d6c4b6125551f78606fb4950a6d40893a42c..24147ac212ae5c5f167a0bd87642b95e831a68ce 100644 (file)
@@ -17,7 +17,7 @@ mincore_f(
        int             argc,
        char            **argv)
 {
-       off64_t         offset, llength;
+       off_t           offset, llength;
        size_t          length;
        size_t          blocksize, sectsize;
        void            *start;
index 425957d4b4878ce2dd76f51ef89d4ef95abeab7e..7161ae8ecc050cb190402419857970f5f62e7a1f 100644 (file)
--- a/io/mmap.c
+++ b/io/mmap.c
@@ -63,11 +63,11 @@ print_mapping(
 void *
 check_mapping_range(
        mmap_region_t   *map,
-       off64_t         offset,
+       off_t           offset,
        size_t          length,
        int             pagealign)
 {
-       off64_t         relative;
+       off_t           relative;
 
        if (offset < mapping->offset) {
                printf(_("offset (%lld) is before start of mapping (%lld)\n"),
@@ -155,7 +155,8 @@ mmap_f(
        int             argc,
        char            **argv)
 {
-       off64_t         offset;
+       off_t           offset;
+
        ssize_t         length = 0, length2 = 0;
        void            *address = NULL;
        char            *filename;
@@ -308,7 +309,7 @@ msync_f(
        int             argc,
        char            **argv)
 {
-       off64_t         offset;
+       off_t           offset;
        ssize_t         length;
        void            *start;
        int             c, flags = 0;
@@ -401,7 +402,7 @@ mread_f(
        int             argc,
        char            **argv)
 {
-       off64_t         offset, tmp, dumpoffset, printoffset;
+       off_t           offset, tmp, dumpoffset, printoffset;
        ssize_t         length;
        size_t          dumplen, cnt = 0;
        char            *bp;
@@ -566,7 +567,7 @@ mwrite_f(
        int             argc,
        char            **argv)
 {
-       off64_t         offset, tmp;
+       off_t           offset, tmp;
        ssize_t         length;
        void            *start;
        char            *sp;
index 0f1d8b97b05da58873f0da71973ccdf60705df2f..79990c6a972bb1e673ef4fb8496b32f431ae7a5d 100644 (file)
@@ -116,7 +116,7 @@ alloc_buffer(
 static void
 __dump_buffer(
        void            *buf,
-       off64_t         offset,
+       off_t           offset,
        ssize_t         len)
 {
        int             i, j;
@@ -141,7 +141,7 @@ __dump_buffer(
 
 void
 dump_buffer(
-       off64_t         offset,
+       off_t           offset,
        ssize_t         len)
 {
        int             i, l;
@@ -164,7 +164,7 @@ dump_buffer(
 static ssize_t
 do_preadv(
        int             fd,
-       off64_t         offset,
+       off_t           offset,
        long long       count)
 {
        int             vecs = 0;
@@ -199,7 +199,7 @@ do_preadv(
 static ssize_t
 do_pread(
        int             fd,
-       off64_t         offset,
+       off_t           offset,
        long long       count,
        size_t          buffer_size)
 {
@@ -212,13 +212,13 @@ do_pread(
 static int
 read_random(
        int             fd,
-       off64_t         offset,
+       off_t           offset,
        long long       count,
        long long       *total,
        unsigned int    seed,
        int             eof)
 {
-       off64_t         end, off, range;
+       off_t           end, off, range;
        ssize_t         bytes;
        int             ops = 0;
 
@@ -259,12 +259,12 @@ read_random(
 static int
 read_backward(
        int             fd,
-       off64_t         *offset,
+       off_t           *offset,
        long long       *count,
        long long       *total,
        int             eof)
 {
-       off64_t         end, off = *offset;
+       off_t           end, off = *offset;
        ssize_t         bytes = 0, bytes_requested;
        long long       cnt = *count;
        int             ops = 0;
@@ -319,7 +319,7 @@ read_backward(
 static int
 read_forward(
        int             fd,
-       off64_t         offset,
+       off_t           offset,
        long long       count,
        long long       *total,
        int             verbose,
@@ -353,7 +353,7 @@ read_forward(
 int
 read_buffer(
        int             fd,
-       off64_t         offset,
+       off_t           offset,
        long long       count,
        long long       *total,
        int             verbose,
@@ -368,7 +368,7 @@ pread_f(
        char            **argv)
 {
        size_t          bsize;
-       off64_t         offset;
+       off_t           offset;
        unsigned int    zeed = 0;
        long long       count, total, tmp;
        size_t          fsblocksize, fssectsize;
index 467bfa9f83204780f9af7504fddd1f42e7bbbbd4..8d134c562b23b493d308caae2c18498a3cb34c5d 100644 (file)
@@ -54,7 +54,7 @@ pwrite_help(void)
 static ssize_t
 do_pwritev(
        int             fd,
-       off64_t         offset,
+       off_t           offset,
        long long       count,
        int             pwritev2_flags)
 {
@@ -97,7 +97,7 @@ do_pwritev(
 static ssize_t
 do_pwrite(
        int             fd,
-       off64_t         offset,
+       off_t           offset,
        long long       count,
        size_t          buffer_size,
        int             pwritev2_flags)
@@ -110,13 +110,13 @@ do_pwrite(
 
 static int
 write_random(
-       off64_t         offset,
+       off_t           offset,
        long long       count,
        unsigned int    seed,
        long long       *total,
        int             pwritev2_flags)
 {
-       off64_t         off, range;
+       off_t           off, range;
        ssize_t         bytes;
        int             ops = 0;
 
@@ -155,12 +155,12 @@ write_random(
 
 static int
 write_backward(
-       off64_t         offset,
+       off_t           offset,
        long long       *count,
        long long       *total,
        int             pwritev2_flags)
 {
-       off64_t         end, off = offset;
+       off_t           end, off = offset;
        ssize_t         bytes = 0, bytes_requested;
        long long       cnt = *count;
        int             ops = 0;
@@ -214,11 +214,11 @@ write_backward(
 
 static int
 write_buffer(
-       off64_t         offset,
+       off_t           offset,
        long long       count,
        size_t          bs,
        int             fd,
-       off64_t         skip,
+       off_t           skip,
        long long       *total,
        int             pwritev2_flags)
 {
@@ -253,7 +253,7 @@ write_buffer(
 
 static int
 write_once(
-       off64_t         offset,
+       off_t           offset,
        long long       count,
        long long       *total,
        int             pwritev2_flags)
@@ -275,7 +275,7 @@ pwrite_f(
        char            **argv)
 {
        size_t          bsize;
-       off64_t         offset, skip = 0;
+       off_t           offset, skip = 0;
        long long       count, total, tmp;
        unsigned int    zeed = 0, seed = 0xcdcdcdcd;
        size_t          fsblocksize, fssectsize;
index 8e4f389949be17ca1d382457549b6435362efa9b..b6a3c05a71343a5afbde3372ffbaee4bc0d234bf 100644 (file)
@@ -98,7 +98,7 @@ dedupe_f(
        int             argc,
        char            **argv)
 {
-       off64_t         soffset, doffset;
+       off_t           soffset, doffset;
        long long       count, total;
        char            *infile;
        int             condensed, quiet_flag;
@@ -226,7 +226,7 @@ reflink_f(
        int             argc,
        char            **argv)
 {
-       off64_t         soffset, doffset;
+       off_t           soffset, doffset;
        long long       count = 0, total;
        char            *infile = NULL;
        int             condensed, quiet_flag;
index 6734ecb5691a124995961532f26d47a298b1a072..ffe7439ccaa84ff319f55dde0ae6676ec0b92ec2 100644 (file)
--- a/io/seek.c
+++ b/io/seek.c
@@ -63,8 +63,8 @@ static void
 seek_output(
        int     startflag,
        char    *type,
-       off64_t start,
-       off64_t offset)
+       off_t   start,
+       off_t   offset)
 {
        if (offset == -1) {
                if (errno == ENXIO) {
@@ -92,7 +92,7 @@ seek_f(
        int     argc,
        char    **argv)
 {
-       off64_t         offset, start;
+       off_t           offset, start;
        size_t          fsblocksize, fssectsize;
        int             c;
        int             current;        /* specify data or hole */
index a003bb5518ef0a4461052e25a428926676c02b3d..2ce569c2c7b96cb048a9ad4f4c90685cb1b6856f 100644 (file)
@@ -34,12 +34,12 @@ sendfile_help(void)
 
 static int
 send_buffer(
-       off64_t         offset,
+       off_t           offset,
        size_t          count,
        int             fd,
        long long       *total)
 {
-       off64_t         off = offset;
+       off_t           off = offset;
        ssize_t         bytes, bytes_remaining = count;
        int             ops = 0;
 
@@ -66,7 +66,7 @@ sendfile_f(
        int             argc,
        char            **argv)
 {
-       off64_t         offset = 0;
+       off_t           offset = 0;
        long long       count, total;
        size_t          blocksize, sectsize;
        struct timeval  t1, t2;
index b57f9eefed29a2516ecaedcca525453242b32408..e8f68dc346789ec68fb55fe0a92fbefe058ce4de 100644 (file)
--- a/io/stat.c
+++ b/io/stat.c
@@ -21,7 +21,7 @@ static cmdinfo_t stat_cmd;
 static cmdinfo_t statfs_cmd;
 static cmdinfo_t statx_cmd;
 
-off64_t
+off_t
 filesize(void)
 {
        struct stat     st;
index 94285c22f829d64c2ec45dffb54f7b681b942a8f..2375a060013c975d4868e7f47c9c04e5834b8949 100644 (file)
@@ -30,7 +30,7 @@ sync_range_f(
        int             argc,
        char            **argv)
 {
-       off64_t         offset = 0, length = 0;
+       off_t           offset = 0, length = 0;
        int             c, sync_mode = 0;
        size_t          blocksize, sectsize;
 
index 1d049194d38069f608db56ad6282f6970cc1a5ac..a74b6131ede3f38cc9f1b8bc9a23ebe527f56aba 100644 (file)
@@ -16,7 +16,7 @@ truncate_f(
        int             argc,
        char            **argv)
 {
-       off64_t         offset;
+       off_t           offset;
        size_t          blocksize, sectsize;
 
        init_cvtnum(&blocksize, &sectsize);
index 0e332110b685973a0eeac0694d925c1db1c53a87..153007d5fc86d2b0dd1329579cdbe568e56fe44d 100644 (file)
@@ -576,7 +576,7 @@ libxfs_balloc(
 
 
 static int
-__read_buf(int fd, void *buf, int len, off64_t offset, int flags)
+__read_buf(int fd, void *buf, int len, off_t offset, int flags)
 {
        int     sts;
 
@@ -638,7 +638,7 @@ libxfs_readbufr_map(struct xfs_buftarg *btp, struct xfs_buf *bp, int flags)
 
        buf = bp->b_addr;
        for (i = 0; i < bp->b_nmaps; i++) {
-               off64_t offset = LIBXFS_BBTOOFF64(bp->b_maps[i].bm_bn);
+               off_t   offset = LIBXFS_BBTOOFF64(bp->b_maps[i].bm_bn);
                int len = BBTOB(bp->b_maps[i].bm_len);
 
                error = __read_buf(fd, buf, len, offset, flags);
@@ -797,7 +797,7 @@ err:
 }
 
 static int
-__write_buf(int fd, void *buf, int len, off64_t offset, int flags)
+__write_buf(int fd, void *buf, int len, off_t offset, int flags)
 {
        int     sts;
 
@@ -863,7 +863,7 @@ libxfs_bwrite(
                void    *buf = bp->b_addr;
 
                for (i = 0; i < bp->b_nmaps; i++) {
-                       off64_t offset = LIBXFS_BBTOOFF64(bp->b_maps[i].bm_bn);
+                       off_t   offset = LIBXFS_BBTOOFF64(bp->b_maps[i].bm_bn);
                        int len = BBTOB(bp->b_maps[i].bm_len);
 
                        bp->b_error = __write_buf(fd, buf, len, offset,
index 8e3998db06c0896703838d3aa135c65c4d6f6eb6..334bdd22876377c0213a291e772a114b72db9206 100644 (file)
@@ -160,7 +160,7 @@ verify_device_size(
        } else {
                /* ensure device is sufficiently large enough */
                char            lb[XFS_MAX_SECTORSIZE] = { 0 };
-               off64_t         off;
+               off_t           off;
 
                off = nr_blocks * blocksize - sizeof(lb);
                if (pwrite(dev_fd, lb, sizeof(lb), off) < 0)
index 78c1e397433a608e91c56796f9f581933e9cfdd8..b0dd19775ca86f20c367e8da82824b3cb28c79d3 100644 (file)
@@ -475,7 +475,7 @@ pf_batch_read(
 {
        struct xfs_buf          *bplist[MAX_BUFS];
        unsigned int            num;
-       off64_t                 first_off, last_off, next_off;
+       off_t                   first_off, last_off, next_off;
        int                     len, size;
        int                     i;
        int                     inode_bufs;
index b6fd411816b27fab4494d7df86223e1530946b95..9cefe074c6f64e7ae531c750c0af3b377cb89240 100644 (file)
@@ -97,11 +97,11 @@ scan_ag_rmaps(
        struct scrub_ctx        *ctx = (struct scrub_ctx *)wq->wq_ctx;
        struct scan_blocks      *sbx = arg;
        struct fsmap            keys[2];
-       off64_t                 bperag;
+       off_t                   bperag;
        int                     ret;
 
-       bperag = (off64_t)ctx->mnt.fsgeom.agblocks *
-                (off64_t)ctx->mnt.fsgeom.blocksize;
+       bperag = (off_t)ctx->mnt.fsgeom.agblocks *
+                (off_t)ctx->mnt.fsgeom.blocksize;
 
        memset(keys, 0, sizeof(struct fsmap) * 2);
        keys->fmr_device = ctx->fsinfo.fs_datadev;
index 70dcdb5c923753587b66e59c2f86625d480d30eb..f5177cb4ee5d2ab43a82f92e97a20df8d1389492 100644 (file)
@@ -62,7 +62,7 @@ static void
 addtohist(
        xfs_agnumber_t  agno,
        xfs_agblock_t   agbno,
-       off64_t         len)
+       off_t           len)
 {
        long            i;
 
@@ -152,7 +152,7 @@ scan_ag(
        struct fsmap            *l, *h;
        struct fsmap            *p;
        struct xfs_fd           *xfd = &file->xfd;
-       off64_t                 aglen;
+       off_t                   aglen;
        xfs_agblock_t           agbno;
        unsigned long long      freeblks = 0;
        unsigned long long      freeexts = 0;
index e9ed47e41759c55c95427070a798c56d0bc97b7d..727dd81803065f66c7102485e83aa1a0fc7502ed 100644 (file)
@@ -26,7 +26,7 @@ trim_f(
        struct xfs_fd           *xfd = &file->xfd;
        struct xfs_fsop_geom    *fsgeom = &xfd->fsgeom;
        xfs_agnumber_t          agno = 0;
-       off64_t                 offset = 0;
+       off_t                   offset = 0;
        ssize_t                 length = 0;
        ssize_t                 minlen = 0;
        int                     aflag = 0;