Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-2-2
Commits
72f56af8
Commit
72f56af8
authored
Nov 24, 2010
by
Jean-Baptiste Kempf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Symbian: work-around the absence of pread/pwrite
Signed-off-by:
Jean-Baptiste Kempf
<
jb@videolan.org
>
parent
d273f722
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
1 deletion
+25
-1
configure.ac
configure.ac
+1
-1
src/misc/block.c
src/misc/block.c
+24
-0
No files found.
configure.ac
View file @
72f56af8
...
@@ -547,7 +547,7 @@ dnl Check for system libs needed
...
@@ -547,7 +547,7 @@ dnl Check for system libs needed
need_libc=false
need_libc=false
dnl Check for usual libc functions
dnl Check for usual libc functions
AC_CHECK_FUNCS([daemon fcntl fdopendir fstatvfs fork getenv getpwuid_r gettimeofday isatty lstat memalign mmap openat posix_fadvise posix_madvise posix_memalign setenv setlocale stricmp strnicmp uselocale])
AC_CHECK_FUNCS([daemon fcntl fdopendir fstatvfs fork getenv getpwuid_r gettimeofday isatty lstat memalign mmap openat p
read p
osix_fadvise posix_madvise posix_memalign setenv setlocale stricmp strnicmp uselocale])
AC_REPLACE_FUNCS([asprintf atof atoll getcwd getdelim getpid gmtime_r lldiv localtime_r nrand48 rewind strcasecmp strcasestr strdup strlcpy strncasecmp strndup strnlen strsep strtof strtok_r strtoll swab tdestroy vasprintf])
AC_REPLACE_FUNCS([asprintf atof atoll getcwd getdelim getpid gmtime_r lldiv localtime_r nrand48 rewind strcasecmp strcasestr strdup strlcpy strncasecmp strndup strnlen strsep strtof strtok_r strtoll swab tdestroy vasprintf])
AC_CHECK_FUNCS(fdatasync,,
AC_CHECK_FUNCS(fdatasync,,
[AC_DEFINE(fdatasync, fsync, [Alias fdatasync() to fsync() if missing.])
[AC_DEFINE(fdatasync, fsync, [Alias fdatasync() to fsync() if missing.])
...
...
src/misc/block.c
View file @
72f56af8
...
@@ -385,6 +385,30 @@ ssize_t pread (int fd, void *buf, size_t count, off_t offset)
...
@@ -385,6 +385,30 @@ ssize_t pread (int fd, void *buf, size_t count, off_t offset)
}
}
#endif
#endif
#ifndef HAVE_PREAD
static
ssize_t
pread
(
int
fd
,
const
void
*
buf
,
size_t
size
,
off_t
offset
)
{
off_t
offs0
;
ssize_t
rd
;
if
((
offs0
=
lseek
(
fd
,
0
,
SEEK_CUR
))
==
(
off_t
)
-
1
)
return
-
1
;
if
(
lseek
(
fd
,
offset
,
SEEK_SET
)
==
(
off_t
)
-
1
)
return
-
1
;
rd
=
read
(
fd
,
(
void
*
)
buf
,
size
);
if
(
lseek
(
fd
,
offs0
,
SEEK_SET
)
==
(
off_t
)
-
1
)
return
-
1
;
return
rd
;
}
static
ssize_t
pwrite
(
int
fd
,
const
void
*
buf
,
size_t
size
,
off_t
offset
)
{
off_t
offs0
;
ssize_t
wr
;
if
((
offs0
=
lseek
(
fd
,
0
,
SEEK_CUR
))
==
(
off_t
)
-
1
)
return
-
1
;
if
(
lseek
(
fd
,
offset
,
SEEK_SET
)
==
(
off_t
)
-
1
)
return
-
1
;
wr
=
write
(
fd
,
(
void
*
)
buf
,
size
);
if
(
lseek
(
fd
,
offs0
,
SEEK_SET
)
==
(
off_t
)
-
1
)
return
-
1
;
return
wr
;
}
#endif
/**
/**
* Loads a file into a block of memory. If possible a private file mapping is
* Loads a file into a block of memory. If possible a private file mapping is
* created. Otherwise, the file is read normally. On 32-bits platforms, this
* created. Otherwise, the file is read normally. On 32-bits platforms, this
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment