contrib/vhost-user-blk: Replace lseek64 with lseek
PATCH v2 1/1 contrib/vhost-user-blk: Replace lseek64 with lseek
64bit off_t is already in use since build uses _FILE_OFFSET_BITS=64 already. Using lseek/off_t also makes it work with latest musl without using _LARGEFILE64_SOURCE macro. This macro is implied with _GNU_SOURCE when using glibc but not with musl.
---
v2: Fix typo must->musl
contrib/vhost-user-blk/vhost-user-blk.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
contrib/vhost-user-blk/vhost-user-blk.c +2 -2
@@ -532,9 +532,9 @@ vub_get_blocksize(int fd)static void vub_initialize_config (int fd,struct virtio_blk_config *config) { -off64_t capacity; +off_t capacity; - capacity =lseek64 (fd,0 ,SEEK_END ); + capacity =lseek (fd,0 ,SEEK_END ); config->capacity = capacity >>9 ; config->blk_size =vub_get_blocksize (fd); config->size_max =65536 ;
Signature · 1 line
2.39.0
Quoted 20 lines · Khem Raj
64bit
off_tis already in use since build uses _FILE_OFFSET_BITS=64 already. Using lseek/off_t also makes it work with latest musl without using_LARGEFILE64_SOURCEmacro. This macro is implied with_GNU_SOURCEwhen using glibc but not with musl.Signed-off-by Khem Raj <[email protected]>Cc Michael S. Tsirkin <[email protected]>CC Raphael Norwitz <[email protected]>---
v2: Fix typomust->muslcontrib/vhost-user-blk/vhost-user-blk.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)contrib/vhost-user-blk/vhost-user-blk.c +0
-0@@ -532,9 +532,9 @@ vub_get_blocksize(int fd) static void
contrib/vhost-user-blk/vhost-user-blk.c vub_get_blocksize(int fd) · line 540
Quoted 10 lines
contrib/vhost-user-blk/vhost-user-blk.c +2
-2vub_initialize_config(int fd, struct virtio_blk_config *config) { - off64_t capacity; + off_t capacity; - capacity =lseek64 (fd,0 ,SEEK_END ); + capacity =lseek (fd,0 ,SEEK_END ); config->capacity = capacity >>9 ; config->blk_size =vub_get_blocksize (fd); config->size_max =65536 ;
Quoted 37 lines · Khem Raj
64bit
off_tis already in use since build uses _FILE_OFFSET_BITS=64 already. Using lseek/off_t also makes it work with latest musl without using_LARGEFILE64_SOURCEmacro. This macro is implied with_GNU_SOURCEwhen using glibc but not with musl.Signed-off-by Khem Raj <[email protected]>Cc Michael S. Tsirkin <[email protected]>CC Raphael Norwitz <[email protected]>---
v2: Fix typomust->musl
contrib/vhost-user-blk/vhost-user-blk.c| 4 ++--1 file changed, 2 insertions(+), 2 deletions(-)contrib/vhost-user-blk/vhost-user-blk.c +0
-0@@ -532,9 +532,9 @@ vub_get_blocksize(int fd)static void
vub_initialize_config(int fd, struct virtio_blk_config *config){contrib/vhost-user-blk/vhost-user-blk.c +2
-2-off64_t capacity; +off_t capacity; - capacity =lseek64 (fd,0 ,SEEK_END ); + capacity =lseek (fd,0 ,SEEK_END ); config->capacity = capacity >>9 ; config->blk_size =vub_get_blocksize (fd); config->size_max =65536 ;Signature · 1 line
2.39.0