Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
M
mongoose
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Ganil-acq
GANILinux
linux-service
library
mongoose
Commits
4f2205a6
Commit
4f2205a6
authored
10 years ago
by
Miodrag Milanovic
Browse files
Options
Downloads
Patches
Plain Diff
OS/2 patches by KO Myung-Hun
Upstream patch from MAME project
parent
6cec1d36
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
mongoose.c
+36
-0
36 additions, 0 deletions
mongoose.c
with
36 additions
and
0 deletions
mongoose.c
+
36
−
0
View file @
4f2205a6
...
@@ -124,7 +124,12 @@ typedef struct _stati64 ns_stat_t;
...
@@ -124,7 +124,12 @@ typedef struct _stati64 ns_stat_t;
#include
<sys/socket.h>
#include
<sys/socket.h>
#include
<sys/select.h>
#include
<sys/select.h>
#define closesocket(x) close(x)
#define closesocket(x) close(x)
#ifndef __OS2__
#define __cdecl
#define __cdecl
#else
#include
<sys/time.h>
typedef
int
socklen_t
;
#endif
#define INVALID_SOCKET (-1)
#define INVALID_SOCKET (-1)
#define to64(x) strtoll(x, NULL, 10)
#define to64(x) strtoll(x, NULL, 10)
typedef
int
sock_t
;
typedef
int
sock_t
;
...
@@ -1579,6 +1584,37 @@ static void *mmap(void *addr, int64_t len, int prot, int flags, int fd,
...
@@ -1579,6 +1584,37 @@ static void *mmap(void *addr, int64_t len, int prot, int flags, int fd,
#define MAP_FAILED NULL
#define MAP_FAILED NULL
#define MAP_PRIVATE 0
#define MAP_PRIVATE 0
#define PROT_READ 0
#define PROT_READ 0
#elif defined(__OS2__)
static
void
*
mmap
(
void
*
addr
,
int64_t
len
,
int
prot
,
int
flags
,
int
fd
,
int
offset
)
{
void
*
p
;
int
pos
=
lseek
(
fd
,
0
,
SEEK_CUR
);
/* Get a current position */
if
(
pos
==
-
1
)
return
NULL
;
/* Seek to offset offset */
if
(
lseek
(
fd
,
offset
,
SEEK_SET
)
==
-
1
)
return
NULL
;
p
=
malloc
(
len
);
/* Read in a file */
if
(
!
p
||
read
(
fd
,
p
,
len
)
==
-
1
)
{
free
(
p
);
p
=
NULL
;
}
/* Restore the position */
lseek
(
fd
,
pos
,
SEEK_SET
);
return
p
;
}
#define munmap(x, y) free(x)
#define MAP_FAILED NULL
#define MAP_PRIVATE 0
#define PROT_READ 0
#else
#else
#include
<sys/mman.h>
#include
<sys/mman.h>
#endif
#endif
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment