Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
0ae38162
Commit
0ae38162
authored
Dec 23, 2010
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
server: Use the syscall function instead of inline assembly.
parent
91ecb05f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
45 deletions
+6
-45
change.c
server/change.c
+3
-24
fd.c
server/fd.c
+3
-21
No files found.
server/change.c
View file @
0ae38162
...
...
@@ -98,38 +98,17 @@ struct inotify_event {
static
inline
int
inotify_init
(
void
)
{
int
ret
;
__asm__
__volatile__
(
"int $0x80"
:
"=a"
(
ret
)
:
"0"
(
SYS_inotify_init
));
if
(
ret
<
0
)
{
errno
=
-
ret
;
ret
=
-
1
;
}
return
ret
;
return
syscall
(
SYS_inotify_init
);
}
static
inline
int
inotify_add_watch
(
int
fd
,
const
char
*
name
,
unsigned
int
mask
)
{
int
ret
;
__asm__
__volatile__
(
"pushl %%ebx;
\n\t
"
"movl %2,%%ebx;
\n\t
"
"int $0x80;
\n\t
"
"popl %%ebx"
:
"=a"
(
ret
)
:
"0"
(
SYS_inotify_add_watch
),
"r"
(
fd
),
"c"
(
name
),
"d"
(
mask
)
);
if
(
ret
<
0
)
{
errno
=
-
ret
;
ret
=
-
1
;
}
return
ret
;
return
syscall
(
SYS_inotify_add_watch
,
fd
,
name
,
mask
);
}
static
inline
int
inotify_rm_watch
(
int
fd
,
int
wd
)
{
int
ret
;
__asm__
__volatile__
(
"pushl %%ebx;
\n\t
"
"movl %2,%%ebx;
\n\t
"
"int $0x80;
\n\t
"
"popl %%ebx"
:
"=a"
(
ret
)
:
"0"
(
SYS_inotify_rm_watch
),
"r"
(
fd
),
"c"
(
wd
)
);
if
(
ret
<
0
)
{
errno
=
-
ret
;
ret
=
-
1
;
}
return
ret
;
return
syscall
(
SYS_inotify_rm_watch
,
fd
,
wd
);
}
#define USE_INOTIFY
...
...
server/fd.c
View file @
0ae38162
...
...
@@ -127,38 +127,20 @@ struct epoll_event
epoll_data_t
data
;
};
#define SYSCALL_RET(ret) do { \
if (ret < 0) { errno = -ret; ret = -1; } \
return ret; \
} while(0)
static
inline
int
epoll_create
(
int
size
)
{
int
ret
;
__asm__
(
"pushl %%ebx; movl %2,%%ebx; int $0x80; popl %%ebx"
:
"=a"
(
ret
)
:
"0"
(
254
/*NR_epoll_create*/
),
"r"
(
size
)
);
SYSCALL_RET
(
ret
);
return
syscall
(
254
/*NR_epoll_create*/
,
size
);
}
static
inline
int
epoll_ctl
(
int
epfd
,
int
op
,
int
fd
,
const
struct
epoll_event
*
event
)
{
int
ret
;
__asm__
(
"pushl %%ebx; movl %2,%%ebx; int $0x80; popl %%ebx"
:
"=a"
(
ret
)
:
"0"
(
255
/*NR_epoll_ctl*/
),
"r"
(
epfd
),
"c"
(
op
),
"d"
(
fd
),
"S"
(
event
),
"m"
(
*
event
)
);
SYSCALL_RET
(
ret
);
return
syscall
(
255
/*NR_epoll_ctl*/
,
epfd
,
op
,
fd
,
event
);
}
static
inline
int
epoll_wait
(
int
epfd
,
struct
epoll_event
*
events
,
int
maxevents
,
int
timeout
)
{
int
ret
;
__asm__
(
"pushl %%ebx; movl %2,%%ebx; int $0x80; popl %%ebx"
:
"=a"
(
ret
)
:
"0"
(
256
/*NR_epoll_wait*/
),
"r"
(
epfd
),
"c"
(
events
),
"d"
(
maxevents
),
"S"
(
timeout
)
:
"memory"
);
SYSCALL_RET
(
ret
);
return
syscall
(
256
/*NR_epoll_wait*/
,
epfd
,
events
,
maxevents
,
timeout
);
}
#undef SYSCALL_RET
#endif
/* linux && __i386__ && HAVE_STDINT_H */
...
...
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