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
beb8fabf
Commit
beb8fabf
authored
Aug 01, 1999
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removed async I/O support.
parent
c9c2a59c
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
0 additions
and
198 deletions
+0
-198
Makefile.in
files/Makefile.in
+0
-1
async.c
files/async.c
+0
-189
file.c
files/file.c
+0
-1
async.h
include/async.h
+0
-6
console.c
win32/console.c
+0
-1
No files found.
files/Makefile.in
View file @
beb8fabf
...
...
@@ -8,7 +8,6 @@ VPATH = @srcdir@
MODULE
=
files
C_SRCS
=
\
async.c
\
change.c
\
directory.c
\
dos_fs.c
\
...
...
files/async.c
deleted
100644 → 0
View file @
c9c2a59c
/*
* Generic async UNIX file IO handling
*
* Copyright 1996,1997 Alex Korobka
* Copyright 1998 Marcus Meissner
*/
/*
* This file handles asynchronous signaling for UNIX filedescriptors.
* The passed handler gets called when input arrived for the filedescriptor.
*
* This is done either by the kernel or (in the WINSOCK case) by the pipe
* handler, since pipes do not support asynchronous signaling.
* (Not all possible filedescriptors support async IO. Generic files do not
* for instance, sockets do, ptys don't.)
*
* To make this a bit better, we would need an additional thread doing select()
*/
#include <assert.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/time.h>
#include <sys/stat.h>
#include <fcntl.h>
#ifdef HAVE_SYS_PARAM_H
# include <sys/param.h>
#endif
#ifdef HAVE_SYS_FILIO_H
# include <sys/filio.h>
#endif
#ifdef HAVE_SYS_FILE_H
# include <sys/file.h>
#endif
#include "xmalloc.h"
#include "windef.h"
#include "miscemu.h"
#include "selectors.h"
#include "sig_context.h"
#include "async.h"
#include "debugtools.h"
typedef
struct
_async_fd
{
int
unixfd
;
void
(
*
handler
)(
int
fd
,
void
*
private
);
void
*
private
;
}
ASYNC_FD
;
static
ASYNC_FD
*
asyncfds
=
NULL
;
static
int
nrofasyncfds
=
0
;
/***************************************************************************
* ASYNC_sigio [internal]
*
* Signal handler for asynchronous IO.
*
* Note: This handler and the function it calls may not block. Neither they
* are allowed to use blocking IO (write/read). No memory management.
* No possible blocking synchronization of any kind.
*/
HANDLER_DEF
(
ASYNC_sigio
)
{
struct
timeval
timeout
;
fd_set
rset
,
wset
;
int
i
,
maxfd
=
0
;
HANDLER_INIT
();
if
(
!
nrofasyncfds
)
return
;
FD_ZERO
(
&
rset
);
FD_ZERO
(
&
wset
);
for
(
i
=
nrofasyncfds
;
i
--
;)
{
if
(
asyncfds
[
i
].
unixfd
==
-
1
)
continue
;
FD_SET
(
asyncfds
[
i
].
unixfd
,
&
rset
);
FD_SET
(
asyncfds
[
i
].
unixfd
,
&
wset
);
if
(
maxfd
<
asyncfds
[
i
].
unixfd
)
maxfd
=
asyncfds
[
i
].
unixfd
;
}
/* select() with timeout values set to 0 is nonblocking. */
memset
(
&
timeout
,
0
,
sizeof
(
timeout
));
if
(
select
(
maxfd
+
1
,
&
rset
,
&
wset
,
NULL
,
&
timeout
)
<=
0
)
return
;
/* Can't be. hmm */
for
(
i
=
nrofasyncfds
;
i
--
;)
if
(
(
FD_ISSET
(
asyncfds
[
i
].
unixfd
,
&
rset
))
||
(
FD_ISSET
(
asyncfds
[
i
].
unixfd
,
&
wset
))
)
asyncfds
[
i
].
handler
(
asyncfds
[
i
].
unixfd
,
asyncfds
[
i
].
private
);
}
/***************************************************************************
* ASYNC_MakeFDAsync [internal]
*
* Makes the passed filedescriptor async (or not) depending on flag.
*/
static
BOOL
ASYNC_MakeFDAsync
(
int
unixfd
,
int
async
)
{
#if !defined(FASYNC) && defined(FIOASYNC)
#define FASYNC FIOASYNC
#endif
#ifdef FASYNC
int
flags
;
#endif
#ifdef F_SETOWN
if
(
-
1
==
fcntl
(
unixfd
,
F_SETOWN
,
getpid
()))
perror
(
"fcntl F_SETOWN <pid>"
);
#endif
#ifdef FASYNC
if
(
-
1
==
fcntl
(
unixfd
,
F_GETFL
,
&
flags
))
{
perror
(
"fcntl F_GETFL"
);
return
FALSE
;
}
if
(
async
)
flags
|=
FASYNC
|
O_NONBLOCK
;
else
flags
&=~
(
FASYNC
|
O_NONBLOCK
);
if
(
-
1
==
fcntl
(
unixfd
,
F_SETFL
,
&
flags
))
{
perror
(
"fcntl F_SETFL FASYNC"
);
return
FALSE
;
}
return
TRUE
;
#else
return
FALSE
;
#endif
}
/***************************************************************************
* ASYNC_RegisterFD [internal]
*
* Register a UNIX filedescriptor with handler and private data pointer.
* this function is _NOT_ safe to be called from a signal handler.
*
* Additional Constraint: The handler passed to this function _MUST_ adhere
* to the same signalsafeness as ASYNC_sigio itself. (nonblocking, no thread/
* signal unsafe operations, no blocking synchronization)
*/
void
ASYNC_RegisterFD
(
int
unixfd
,
void
(
*
handler
)(
int
fd
,
void
*
private
),
void
*
private
)
{
int
i
;
SIGNAL_MaskAsyncEvents
(
TRUE
);
for
(
i
=
0
;
i
<
nrofasyncfds
;
i
++
)
{
if
(
asyncfds
[
i
].
unixfd
==
unixfd
)
{
/* Might be a leftover entry. Make fd async anyway... */
if
(
asyncfds
[
i
].
handler
==
handler
)
{
ASYNC_MakeFDAsync
(
unixfd
,
1
);
SIGNAL_MaskAsyncEvents
(
FALSE
);
return
;
}
}
}
for
(
i
=
0
;
i
<
nrofasyncfds
;
i
++
)
if
(
asyncfds
[
i
].
unixfd
==
-
1
)
break
;
if
(
i
==
nrofasyncfds
)
{
if
(
nrofasyncfds
)
asyncfds
=
(
ASYNC_FD
*
)
xrealloc
(
asyncfds
,
sizeof
(
ASYNC_FD
)
*
(
nrofasyncfds
+
1
));
else
asyncfds
=
(
ASYNC_FD
*
)
xmalloc
(
sizeof
(
ASYNC_FD
)
*
1
);
nrofasyncfds
++
;
}
asyncfds
[
i
].
unixfd
=
unixfd
;
asyncfds
[
i
].
handler
=
handler
;
asyncfds
[
i
].
private
=
private
;
ASYNC_MakeFDAsync
(
unixfd
,
1
);
SIGNAL_MaskAsyncEvents
(
FALSE
);
}
/***************************************************************************
* ASYNC_UnregisterFD [internal]
*
* Unregister a UNIX filedescriptor with handler. This function is basically
* signal safe, but try to not call it in the signal handler anyway.
*/
void
ASYNC_UnregisterFD
(
int
unixfd
,
void
(
*
handler
)(
int
fd
,
void
*
private
))
{
int
i
;
for
(
i
=
nrofasyncfds
;
i
--
;)
if
((
asyncfds
[
i
].
unixfd
==
unixfd
)
||
(
asyncfds
[
i
].
handler
==
handler
))
break
;
if
(
i
==
nrofasyncfds
)
return
;
asyncfds
[
i
].
unixfd
=
-
1
;
asyncfds
[
i
].
handler
=
NULL
;
asyncfds
[
i
].
private
=
NULL
;
return
;
}
files/file.c
View file @
beb8fabf
...
...
@@ -45,7 +45,6 @@
#include "ldt.h"
#include "process.h"
#include "task.h"
#include "async.h"
#include "wincon.h"
#include "debugtools.h"
...
...
include/async.h
deleted
100644 → 0
View file @
c9c2a59c
#ifndef __WINE_ASYNC_H
#define __WINE_ASYNC_H
extern
void
ASYNC_RegisterFD
(
int
unixfd
,
void
(
*
handler
)(
int
fd
,
void
*
private
),
void
*
private
);
extern
void
ASYNC_UnregisterFD
(
int
unixfd
,
void
(
*
handler
)(
int
fd
,
void
*
private
));
#endif
win32/console.c
View file @
beb8fabf
...
...
@@ -39,7 +39,6 @@
#include "wine/winuser16.h"
#include "wine/keyboard16.h"
#include "thread.h"
#include "async.h"
#include "file.h"
#include "process.h"
#include "winerror.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