info: pciutils

Wojtek Slusarczyk wojtek w SHADOW.EU.ORG
Śro, 7 Paź 1998, 19:36:54 CEST


On Wed, 7 Oct 1998, Krzysztof G. Baranowski wrote:

> Wojtku,
> 
> jezeli bedziesz wprowadzal jakies zmiany, to wyjatkowo prosilbym o
> (pseudo)diffa. TIA.

Krzysku, najpierw wprowadzmy jedna ale za to porzadna zmiane i to w kodzie
zrodlowym programiku ktory ustawia PCI -> wolalbym tam sam nie grzebac...

Sprawa wyglada tak:

setpci.c:78: conflicting types for `pread'
/usr/include/unistd.h:320: previous declaration of `pread'
setpci.c:86: conflicting types for `pwrite'
/usr/include/unistd.h:322: previous declaration of `pwrite'
make: *** [setpci.o] Error 1

Cytowany przez egcsa naglowek: 

#ifdef __USE_UNIX98
/* Read NBYTES into BUF from FD at the given position OFFSET without
   changing the file pointer.  Return the number read, -1 for errors
   or 0 for EOF.  */
extern ssize_t __pread64 __P ((int __fd, __ptr_t __buf, size_t __nbytes,
			       __off64_t __offset));
/* Write N bytes of BUF to FD at the given position OFFSET without
   changing the file pointer.  Return the number written, or -1.  */
extern ssize_t __pwrite64 __P ((int __fd, __const __ptr_t __buf, size_t __n,
				__off64_t __offset));

# ifndef __USE_FILE_OFFSET64
extern ssize_t pread __P ((int __fd, __ptr_t __buf, size_t __nbytes,
			   __off_t __offset));
extern ssize_t pwrite __P ((int __fd, __const __ptr_t __buf, size_t __n,
			    __off_t __offset));
# else
#  ifdef __REDIRECT
extern ssize_t __REDIRECT (pread, __P ((int __fd, __ptr_t __buf,
					size_t __nbytes,__off64_t __offset)),
			   pread64);
extern ssize_t __REDIRECT (pwrite, __P ((int __fd, __const __ptr_t __buf,
					 size_t __nbytes, __off64_t __offset)),
			pwrite64);
#  else
#   define pread pread64
#   define pwrite pwrite64
#  endif
# endif

I dla przypomnienia interesujacy nas fragment kodu:

#ifdef __GLIBC__
#ifndef SYS_pread
#define SYS_pread __NR_pread
#endif
static int
pread(unsigned int fd, void *buf, size_t size, loff_t where)
{
  return syscall(SYS_pread, fd, buf, size, where);
}
#ifndef SYS_pwrite
#define SYS_pwrite __NR_pwrite
#endif
static int
pwrite(unsigned int fd, void *buf, size_t size, loff_t where)
{
  return syscall(SYS_pwrite, fd, buf, size, where);
}
#else
static _syscall4(int, pread, unsigned int, fd, void *, buf, size_t, size, loff_t, where);
static _syscall4(int, pwrite, unsigned int, fd, void *, buf, size_t, size, loff_t, where);
#endif

na razie,

Wojciech Slusarczyk (091)4494148
Technical University of Szczecin
PGP KeyServer pgpkeys.mit.edu



Więcej informacji o liście dyskusyjnej pld-devel-pl