|
# --- ROCK-COPYRIGHT-NOTE-BEGIN ---
|
|
#
|
|
# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
|
|
# Please add additional copyright information _after_ the line containing
|
|
# the ROCK-COPYRIGHT-NOTE-END tag. Otherwise it might get removed by
|
|
# the ./scripts/Create-CopyPatch script. Do not edit this copyright text!
|
|
#
|
|
# ROCK Linux: rock-src/package/base/util-linux/no-syscall5.patch.mips
|
|
# ROCK Linux is Copyright (C) 1998 - 2006 Clifford Wolf
|
|
#
|
|
# This patch file is dual-licensed. It is available under the license the
|
|
# patched project is licensed under, as long as it is an OpenSource license
|
|
# as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
|
|
# of the GNU General Public License as published by the Free Software
|
|
# Foundation; either version 2 of the License, or (at your option) any later
|
|
# version.
|
|
#
|
|
# --- ROCK-COPYRIGHT-NOTE-END ---
|
|
|
|
diff -dur util-linux-2.12h/fdisk/cfdisk.c util-linux-2.12h-patch/fdisk/cfdisk.c
|
|
--- util-linux-2.12h/fdisk/cfdisk.c 2004-09-27 15:54:13.000000000 +0000
|
|
+++ util-linux-2.12h-patch/fdisk/cfdisk.c 2004-10-23 03:20:23.614040976 +0000
|
|
@@ -82,9 +82,6 @@
|
|
#include "xstrncpy.h"
|
|
#include "common.h"
|
|
|
|
-extern long long ext2_llseek(unsigned int fd, long long offset,
|
|
- unsigned int origin);
|
|
-
|
|
#define VERSION UTIL_LINUX_VERSION
|
|
|
|
#define DEFAULT_DEVICE "/dev/hda"
|
|
@@ -545,16 +542,16 @@
|
|
}
|
|
|
|
static void
|
|
-read_sector(char *buffer, long long sect_num) {
|
|
- if (ext2_llseek(fd, sect_num*SECTOR_SIZE, SEEK_SET) < 0)
|
|
+read_sector(char *buffer, off_t sect_num) {
|
|
+ if (lseek(fd, sect_num*SECTOR_SIZE, SEEK_SET) < 0)
|
|
fatal(_("Cannot seek on disk drive"), 2);
|
|
if (read(fd, buffer, SECTOR_SIZE) != SECTOR_SIZE)
|
|
fatal(_("Cannot read disk drive"), 2);
|
|
}
|
|
|
|
static void
|
|
-write_sector(char *buffer, long long sect_num) {
|
|
- if (ext2_llseek(fd, sect_num*SECTOR_SIZE, SEEK_SET) < 0)
|
|
+write_sector(char *buffer, off_t sect_num) {
|
|
+ if (lseek(fd, sect_num*SECTOR_SIZE, SEEK_SET) < 0)
|
|
fatal(_("Cannot seek on disk drive"), 2);
|
|
if (write(fd, buffer, SECTOR_SIZE) != SECTOR_SIZE)
|
|
fatal(_("Cannot write disk drive"), 2);
|
|
@@ -578,10 +575,10 @@
|
|
#define DOS_OSTYPE_SZ 8
|
|
#define DOS_LABEL_SZ 11
|
|
#define DOS_FSTYPE_SZ 8
|
|
- long long offset;
|
|
+ off_t offset;
|
|
|
|
offset = (p_info[i].first_sector + p_info[i].offset) * SECTOR_SIZE;
|
|
- if (ext2_llseek(fd, offset, SEEK_SET) == offset
|
|
+ if (lseek(fd, offset, SEEK_SET) == offset
|
|
&& read(fd, §or, sizeof(sector)) == sizeof(sector)) {
|
|
dos_copy_to_info(p_info[i].ostype, OSTYPESZ,
|
|
sector+DOS_OSTYPE_OFFSET, DOS_OSTYPE_SZ);
|
|
@@ -638,12 +635,12 @@
|
|
} xfsb;
|
|
|
|
char *label;
|
|
- long long offset;
|
|
+ off_t offset;
|
|
int j;
|
|
|
|
offset = (p_info[i].first_sector + p_info[i].offset) * SECTOR_SIZE
|
|
+ 1024;
|
|
- if (ext2_llseek(fd, offset, SEEK_SET) == offset
|
|
+ if (lseek(fd, offset, SEEK_SET) == offset
|
|
&& read(fd, &e2fsb, sizeof(e2fsb)) == sizeof(e2fsb)
|
|
&& e2fsb.s_magic[0] + (e2fsb.s_magic[1]<<8) == EXT2_SUPER_MAGIC) {
|
|
label = e2fsb.s_volume_name;
|
|
@@ -659,7 +656,7 @@
|
|
}
|
|
|
|
offset = (p_info[i].first_sector + p_info[i].offset) * SECTOR_SIZE + 0;
|
|
- if (ext2_llseek(fd, offset, SEEK_SET) == offset
|
|
+ if (lseek(fd, offset, SEEK_SET) == offset
|
|
&& read(fd, &xfsb, sizeof(xfsb)) == sizeof(xfsb)
|
|
&& !strcmp(xfsb.s_magic, XFS_SUPER_MAGIC)) {
|
|
label = xfsb.s_fname;
|
|
@@ -673,7 +670,7 @@
|
|
/* reiserfs? */
|
|
offset = (p_info[i].first_sector + p_info[i].offset) * SECTOR_SIZE
|
|
+ REISERFS_DISK_OFFSET_IN_BYTES;
|
|
- if (ext2_llseek(fd, offset, SEEK_SET) == offset
|
|
+ if (lseek(fd, offset, SEEK_SET) == offset
|
|
&& read(fd, &reiserfsb, 1024) == 1024
|
|
&& is_reiserfs_magic_string(&reiserfsb)) {
|
|
strncpy(p_info[i].fstype, "reiserfs", FSTYPESZ);
|
|
Nur in util-linux-2.12h-patch/fdisk: cfdisk.c~.
|
|
diff -dur util-linux-2.12h/fdisk/fdiskbsdlabel.c util-linux-2.12h-patch/fdisk/fdiskbsdlabel.c
|
|
--- util-linux-2.12h/fdisk/fdiskbsdlabel.c 2003-07-13 21:12:47.000000000 +0000
|
|
+++ util-linux-2.12h-patch/fdisk/fdiskbsdlabel.c 2004-10-23 03:20:23.616040672 +0000
|
|
@@ -566,7 +566,7 @@
|
|
sector = get_start_sect(xbsd_part);
|
|
#endif
|
|
|
|
- if (ext2_llseek (fd, (long long) sector * SECTOR_SIZE, SEEK_SET) == -1)
|
|
+ if (lseek (fd, (off_t) sector * SECTOR_SIZE, SEEK_SET) == -1)
|
|
fatal (unable_to_seek);
|
|
if (BSD_BBSIZE != write (fd, disklabelbuffer, BSD_BBSIZE))
|
|
fatal (unable_to_write);
|
|
@@ -735,7 +735,7 @@
|
|
sector = 0;
|
|
#endif
|
|
|
|
- if (ext2_llseek (fd, (long long) sector * SECTOR_SIZE, SEEK_SET) == -1)
|
|
+ if (lseek (fd, (off_t) sector * SECTOR_SIZE, SEEK_SET) == -1)
|
|
fatal (unable_to_seek);
|
|
if (BSD_BBSIZE != read (fd, disklabelbuffer, BSD_BBSIZE))
|
|
fatal (unable_to_read);
|
|
@@ -781,12 +781,12 @@
|
|
|
|
#if defined (__alpha__) && BSD_LABELSECTOR == 0
|
|
alpha_bootblock_checksum (disklabelbuffer);
|
|
- if (ext2_llseek (fd, (long long) 0, SEEK_SET) == -1)
|
|
+ if (lseek (fd, (off_t) 0, SEEK_SET) == -1)
|
|
fatal (unable_to_seek);
|
|
if (BSD_BBSIZE != write (fd, disklabelbuffer, BSD_BBSIZE))
|
|
fatal (unable_to_write);
|
|
#else
|
|
- if (ext2_llseek (fd, (long long) sector * SECTOR_SIZE + BSD_LABELOFFSET,
|
|
+ if (lseek (fd, (off_t) sector * SECTOR_SIZE + BSD_LABELOFFSET,
|
|
SEEK_SET) == -1)
|
|
fatal (unable_to_seek);
|
|
if (sizeof (struct xbsd_disklabel) != write (fd, d, sizeof (struct xbsd_disklabel)))
|
|
Nur in util-linux-2.12h-patch/fdisk: fdiskbsdlabel.c~.
|
|
diff -dur util-linux-2.12h/fdisk/fdisk.c util-linux-2.12h-patch/fdisk/fdisk.c
|
|
--- util-linux-2.12h/fdisk/fdisk.c 2004-09-06 20:36:16.000000000 +0000
|
|
+++ util-linux-2.12h-patch/fdisk/fdisk.c 2004-10-23 03:20:23.619040216 +0000
|
|
@@ -240,7 +240,7 @@
|
|
static void
|
|
seek_sector(int fd, unsigned int secno) {
|
|
long long offset = (long long) secno * sector_size;
|
|
- if (ext2_llseek(fd, offset, SEEK_SET) == (long long) -1)
|
|
+ if (lseek(fd, offset, SEEK_SET) == (off_t) -1)
|
|
fatal(unable_to_seek);
|
|
}
|
|
|
|
Nur in util-linux-2.12h-patch/fdisk: fdisk.c~.
|
|
diff -dur util-linux-2.12h/fdisk/fdisksgilabel.c util-linux-2.12h-patch/fdisk/fdisksgilabel.c
|
|
--- util-linux-2.12h/fdisk/fdisksgilabel.c 2004-09-06 20:44:56.000000000 +0000
|
|
+++ util-linux-2.12h-patch/fdisk/fdisksgilabel.c 2004-10-23 03:20:23.620040064 +0000
|
|
@@ -377,7 +377,7 @@
|
|
*/
|
|
sgiinfo *info = fill_sgiinfo();
|
|
int infostartblock = SSWAP32(sgilabel->directory[0].vol_file_start);
|
|
- if (ext2_llseek(fd, (long long)infostartblock*
|
|
+ if (lseek(fd, (off_t)infostartblock*
|
|
SECTOR_SIZE, SEEK_SET) < 0)
|
|
fatal(unable_to_seek);
|
|
if (write(fd, info, SECTOR_SIZE) != SECTOR_SIZE)
|
|
Nur in util-linux-2.12h-patch/fdisk: fdisksgilabel.c~.
|
|
Nur in util-linux-2.12h/fdisk: llseek.c.
|
|
diff -dur util-linux-2.12h/fdisk/Makefile util-linux-2.12h-patch/fdisk/Makefile
|
|
--- util-linux-2.12h/fdisk/Makefile 2004-09-06 20:28:58.000000000 +0000
|
|
+++ util-linux-2.12h-patch/fdisk/Makefile 2004-10-23 03:21:43.351918976 +0000
|
|
@@ -39,7 +39,7 @@
|
|
endif
|
|
endif
|
|
|
|
-cfdisk: cfdisk.o llseek.o disksize.o i386_sys_types.o $(LIB)/xstrncpy.o
|
|
+cfdisk: cfdisk.o disksize.o i386_sys_types.o $(LIB)/xstrncpy.o
|
|
ifeq "$(HAVE_SLANG)" "yes"
|
|
$(CC) $(LDFLAGS) $^ -o $@ $(LIBSLANG)
|
|
else
|
|
@@ -55,7 +55,7 @@
|
|
rm -f activate
|
|
ln -s sfdisk activate
|
|
|
|
-fdisk: fdisk.o llseek.o disksize.o fdiskbsdlabel.o fdisksgilabel.o \
|
|
+fdisk: fdisk.o disksize.o fdiskbsdlabel.o fdisksgilabel.o \
|
|
fdisksunlabel.o fdiskaixlabel.o i386_sys_types.o partname.o
|
|
fdisk.o: fdisk.c fdisk.h
|
|
fdiskbsdlabel.o: fdiskbsdlabel.c fdisk.h fdiskbsdlabel.h
|
|
Nur in util-linux-2.12h-patch/fdisk: Makefile~.
|
|
Nur in util-linux-2.12h-patch/fdisk: Makefile.rej.
|
|
diff -dur util-linux-2.12h/fdisk/sfdisk.c util-linux-2.12h-patch/fdisk/sfdisk.c
|
|
--- util-linux-2.12h/fdisk/sfdisk.c 2004-09-28 17:10:21.000000000 +0000
|
|
+++ util-linux-2.12h-patch/fdisk/sfdisk.c 2004-10-23 03:27:03.788205256 +0000
|
|
@@ -148,10 +148,7 @@
|
|
/*
|
|
* sseek: seek to specified sector - return 0 on failure
|
|
*
|
|
- * For >4GB disks lseek needs a > 32bit arg, and we have to use llseek.
|
|
- * On the other hand, a 32 bit sector number is OK until 2TB.
|
|
- * The routines _llseek and sseek below are the only ones that
|
|
- * know about the loff_t type.
|
|
+ * This relies on _FILE_OFFSET_BITS=64.
|
|
*
|
|
* Note: we use 512-byte sectors here, irrespective of the hardware ss.
|
|
*/
|
|
@@ -161,22 +158,15 @@
|
|
#endif
|
|
|
|
#ifndef use_lseek
|
|
-static __attribute__used
|
|
-_syscall5(int, _llseek, unsigned int, fd, ulong, hi, ulong, lo,
|
|
- loff_t *, res, unsigned int, wh);
|
|
#endif
|
|
|
|
static int
|
|
sseek(char *dev, unsigned int fd, unsigned long s) {
|
|
- loff_t in, out;
|
|
- in = ((loff_t) s << 9);
|
|
+ off_t in, out;
|
|
+ in = ((off_t) s << 9);
|
|
out = 1;
|
|
|
|
-#ifndef use_lseek
|
|
- if (_llseek (fd, in>>32, in & 0xffffffff, &out, SEEK_SET) != 0) {
|
|
-#else
|
|
if ((out = lseek(fd, in, SEEK_SET)) != in) {
|
|
-#endif
|
|
perror("llseek");
|
|
error(_("seek error on %s - cannot seek to %lu\n"), dev, s);
|
|
return 0;
|
|
Nur in util-linux-2.12h-patch/fdisk: sfdisk.c~.
|
|
Nur in util-linux-2.12h-patch/fdisk: sfdisk.c.rej.
|
|
Nur in util-linux-2.12h-patch/: MCONFIG~.
|
|
Nur in util-linux-2.12h-patch/mount: mount.c~.
|
|
diff -dur util-linux-2.12h/partx/partx.c util-linux-2.12h-patch/partx/partx.c
|
|
--- util-linux-2.12h/partx/partx.c 2004-08-23 20:13:27.000000000 +0000
|
|
+++ util-linux-2.12h-patch/partx/partx.c 2004-10-23 03:20:23.628038848 +0000
|
|
@@ -332,30 +332,16 @@
|
|
|
|
/*
|
|
* sseek: seek to specified sector
|
|
+ *
|
|
+ * This relies on _FILE_OFFSET_BITS=64.
|
|
*/
|
|
-#if !defined (__alpha__) && !defined (__ia64__) && !defined (__s390x__) && !defined(__x86_64__)
|
|
-#define NEED__llseek
|
|
-#endif
|
|
-
|
|
-#ifdef NEED__llseek
|
|
-#include <linux/unistd.h> /* _syscall */
|
|
-static
|
|
-_syscall5(int, _llseek, uint, fd, ulong, hi, ulong, lo,
|
|
- long long *, res, uint, wh);
|
|
-#endif
|
|
-
|
|
static int
|
|
sseek(int fd, unsigned int secnr) {
|
|
- long long in, out;
|
|
- in = ((long long) secnr << 9);
|
|
+ off_t in, out;
|
|
+ in = ((off_t) secnr << 9);
|
|
out = 1;
|
|
|
|
-#ifdef NEED__llseek
|
|
- if (_llseek (fd, in>>32, in & 0xffffffff, &out, SEEK_SET) != 0
|
|
- || out != in)
|
|
-#else
|
|
if ((out = lseek(fd, in, SEEK_SET)) != in)
|
|
-#endif
|
|
{
|
|
fprintf(stderr, "llseek error\n");
|
|
return -1;
|
|
Nur in util-linux-2.12h-patch/partx: partx.c~.
|
|
diff -dur util-linux-2.12h/po/POTFILES.in util-linux-2.12h-patch/po/POTFILES.in
|
|
--- util-linux-2.12h/po/POTFILES.in 2004-09-07 01:02:39.000000000 +0000
|
|
+++ util-linux-2.12h-patch/po/POTFILES.in 2004-10-23 03:20:23.622039760 +0000
|
|
@@ -19,7 +19,6 @@
|
|
fdisk/fdisksgilabel.c
|
|
fdisk/fdisksunlabel.c
|
|
fdisk/i386_sys_types.c
|
|
-fdisk/llseek.c
|
|
fdisk/partname.c
|
|
fdisk/sfdisk.c
|
|
getopt/getopt.c
|
|
Nur in util-linux-2.12h-patch/po: POTFILES.in~.
|