Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
M
mongoose
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
esp
mongoose
Commits
6cdb9f7e
Commit
6cdb9f7e
authored
Mar 04, 2015
by
Sergey Lyubka
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #474 from mmicko/master
OS/2 patches by KO Myung-Hun
parents
4502dd0c
4f2205a6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
0 deletions
+36
-0
mongoose.c
mongoose.c
+36
-0
No files found.
mongoose.c
View file @
6cdb9f7e
...
...
@@ -126,7 +126,12 @@ typedef struct _stati64 ns_stat_t;
#include <sys/socket.h>
#include <sys/select.h>
#define closesocket(x) close(x)
#ifndef __OS2__
#define __cdecl
#else
#include <sys/time.h>
typedef
int
socklen_t
;
#endif
#define INVALID_SOCKET (-1)
#define to64(x) strtoll(x, NULL, 10)
typedef
int
sock_t
;
...
...
@@ -1581,6 +1586,37 @@ static void *mmap(void *addr, int64_t len, int prot, int flags, int fd,
#define MAP_FAILED NULL
#define MAP_PRIVATE 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
#include <sys/mman.h>
#endif
...
...
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