Re: non-linux support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Apr 22, 2008 at 02:12:45AM +0100, Samuel Thibault wrote:
>  
> +#ifdef __linux__
>  static ssize_t
>  read_lastoddsector(int fd, uint64_t lba, void *buffer, size_t count)
>  {
> @@ -148,6 +149,7 @@ read_lastoddsector(int fd, uint64_t lba, void *buffer, size_t count)
>  
>          return !rc;
>  }
> +#endif
>  
>  static ssize_t
>  read_lba(int fd, uint64_t lba, void *buffer, size_t bytes)
> @@ -159,6 +161,7 @@ read_lba(int fd, uint64_t lba, void *buffer, size_t bytes)
>  	lseek(fd, offset, SEEK_SET);
>  	bytesread = read(fd, buffer, bytes);
>  
> +#ifdef __linux__
>          /* Kludge.  This is necessary to read/write the last
>             block of an odd-sized disk, until Linux 2.5.x kernel fixes.
>             This is only used by gpt.c, and only to read
> @@ -166,6 +169,7 @@ read_lba(int fd, uint64_t lba, void *buffer, size_t bytes)
>          */
>          if (!bytesread && !(last_lba(fd) & 1) && lba == last_lba(fd))
>                  bytesread = read_lastoddsector(fd, lba, buffer, bytes);
> +#endif
>          return bytesread;
>  }

 Can't we use #ifdef BLKGETLASTSECT rather than __linux__?

    Karel

-- 
 Karel Zak  <kzak@xxxxxxxxxx>
--
To unsubscribe from this list: send the line "unsubscribe util-linux-ng" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux