All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hannes Reinecke <hare@suse.de>
To: christophe varoqui <christophe.varoqui@free.fr>
Cc: device-mapper development <dm-devel@redhat.com>
Subject: [kpartx] Use lseek64 instead of self-defined syscall
Date: Wed, 07 Dec 2005 15:46:55 +0100	[thread overview]
Message-ID: <4396F5DF.9090105@suse.de> (raw)

[-- Attachment #1: Type: text/plain, Size: 275 bytes --]

Hi Christophe,

this patch enables kpartx to use lseek64 instead of a self-defined syscall.

Cheers,

Hannes
-- 
Dr. Hannes Reinecke			hare@suse.de
SuSE Linux Products GmbH		S390 & zSeries
Maxfeldstraße 5				+49 911 74053 688
90409 Nürnberg				http://www.suse.de

[-- Attachment #2: kpartx-use-lseek64.patch --]
[-- Type: text/x-patch, Size: 2076 bytes --]

[kpartx] use lseek64 instead of self-defined syscall.

---
commit 400137e766f9585ae5d9038ce769810757e3b344
tree 0a9974d358e0f6443e23794b1f37b0609987f249
parent d43d7b77542d8459c30f82062f5c76954f124062
author Hannes Reinecke,SUSE LINUX GmbH; Maxfeldstrasse 5; D-90409 Nuernberg; Zi. 2.2-20,+49-911-740 53-688,,serv=wotan,mail=imap-dhs,type=real <hare@lammermuir.suse.de> Wed, 07 Dec 2005 15:44:56 +0100
committer Hannes Reinecke,SUSE LINUX GmbH; Maxfeldstrasse 5; D-90409 Nuernberg; Zi. 2.2-20,+49-911-740 53-688,,serv=wotan,mail=imap-dhs,type=real <hare@lammermuir.suse.de> Wed, 07 Dec 2005 15:44:56 +0100

 kpartx/Makefile |    2 +-
 kpartx/kpartx.c |   19 +++----------------
 2 files changed, 4 insertions(+), 17 deletions(-)

diff --git a/kpartx/Makefile b/kpartx/Makefile
--- a/kpartx/Makefile
+++ b/kpartx/Makefile
@@ -6,7 +6,7 @@ BUILD=glibc
 
 include ../Makefile.inc
 
-CFLAGS = -pipe -g -Wall -Wunused -Wstrict-prototypes -I.
+CFLAGS = -pipe -g -Wall -Wunused -Wstrict-prototypes -I. -D_LARGEFILE64_SOURCE
 
 ifeq ($(strip $(BUILD)),klibc)
 	OBJS = bsd.o dos.o kpartx.o solaris.o unixware.o gpt.o crc32.o \
diff --git a/kpartx/kpartx.c b/kpartx/kpartx.c
--- a/kpartx/kpartx.c
+++ b/kpartx/kpartx.c
@@ -465,27 +465,14 @@ xmalloc (size_t size) {
 /*
  * sseek: seek to specified sector
  */
-#if !defined (__alpha__) && !defined (__ia64__) && !defined (__x86_64__) \
-	&& !defined (__s390x__)
-#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);
+	off64_t in, out;
+	in = ((off64_t) secnr << 9);
 	out = 1;
 
-#if !defined (__alpha__) && !defined (__ia64__) && !defined (__x86_64__) \
-	&& !defined (__s390x__)
-	if (_llseek (fd, in>>32, in & 0xffffffff, &out, SEEK_SET) != 0
-	    || out != in)
-#else
-	if ((out = lseek(fd, in, SEEK_SET)) != in)
-#endif
+	if ((out = lseek64(fd, in, SEEK_SET)) != in)
 	{
 		fprintf(stderr, "llseek error\n");
 		return -1;

[-- Attachment #3: Type: text/plain, Size: 0 bytes --]



             reply	other threads:[~2005-12-07 14:46 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-12-07 14:46 Hannes Reinecke [this message]
2005-12-07 22:53 ` [kpartx] Use lseek64 instead of self-defined syscall Christophe Varoqui

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4396F5DF.9090105@suse.de \
    --to=hare@suse.de \
    --cc=christophe.varoqui@free.fr \
    --cc=dm-devel@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.