Cygwin: delete /dev/kmsg and thus fhandler_mailslot without substitution
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
This commit is contained in:
parent
4fe086c84f
commit
23b5ecdaf3
|
@ -283,7 +283,6 @@ DLL_OFILES:= \
|
||||||
fhandler_dsp.o \
|
fhandler_dsp.o \
|
||||||
fhandler_fifo.o \
|
fhandler_fifo.o \
|
||||||
fhandler_floppy.o \
|
fhandler_floppy.o \
|
||||||
fhandler_mailslot.o \
|
|
||||||
fhandler_netdrive.o \
|
fhandler_netdrive.o \
|
||||||
fhandler_nodevice.o \
|
fhandler_nodevice.o \
|
||||||
fhandler_proc.o \
|
fhandler_proc.o \
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -236,7 +236,6 @@ enum fh_devices
|
||||||
FH_FULL = FHDEV (DEV_MEM_MAJOR, 7),
|
FH_FULL = FHDEV (DEV_MEM_MAJOR, 7),
|
||||||
FH_RANDOM = FHDEV (DEV_MEM_MAJOR, 8),
|
FH_RANDOM = FHDEV (DEV_MEM_MAJOR, 8),
|
||||||
FH_URANDOM = FHDEV (DEV_MEM_MAJOR, 9),
|
FH_URANDOM = FHDEV (DEV_MEM_MAJOR, 9),
|
||||||
FH_KMSG = FHDEV (DEV_MEM_MAJOR, 11),
|
|
||||||
|
|
||||||
DEV_SOUND_MAJOR = 14,
|
DEV_SOUND_MAJOR = 14,
|
||||||
FH_OSS_DSP = FHDEV (DEV_SOUND_MAJOR, 3),
|
FH_OSS_DSP = FHDEV (DEV_SOUND_MAJOR, 3),
|
||||||
|
|
|
@ -166,7 +166,6 @@ const _device dev_error_storage =
|
||||||
"/dev/fd%(0-15)d", BRACK(FHDEV(DEV_FLOPPY_MAJOR, {$1})), "\\Device\\Floppy{$1}", exists_ntdev, S_IFBLK
|
"/dev/fd%(0-15)d", BRACK(FHDEV(DEV_FLOPPY_MAJOR, {$1})), "\\Device\\Floppy{$1}", exists_ntdev, S_IFBLK
|
||||||
"/dev/scd%(0-15)d", BRACK(FHDEV(DEV_CDROM_MAJOR, {$1})), "\\Device\\CdRom{$1}", exists_ntdev, S_IFBLK
|
"/dev/scd%(0-15)d", BRACK(FHDEV(DEV_CDROM_MAJOR, {$1})), "\\Device\\CdRom{$1}", exists_ntdev, S_IFBLK
|
||||||
"/dev/sr%(0-15)d", BRACK(FHDEV(DEV_CDROM_MAJOR, {$1})), "\\Device\\CdRom{$1}", exists_ntdev, S_IFBLK
|
"/dev/sr%(0-15)d", BRACK(FHDEV(DEV_CDROM_MAJOR, {$1})), "\\Device\\CdRom{$1}", exists_ntdev, S_IFBLK
|
||||||
"/dev/kmsg", BRACK(FH_KMSG), "\\Device\\MailSlot\\cygwin\\dev\\kmsg", exists_ntdev, S_IFCHR
|
|
||||||
%other {return NULL;}
|
%other {return NULL;}
|
||||||
%%
|
%%
|
||||||
#undef BRACK
|
#undef BRACK
|
||||||
|
|
|
@ -591,9 +591,6 @@ fh_alloc (path_conv& pc)
|
||||||
fh->set_name ("/dev/tty");
|
fh->set_name ("/dev/tty");
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case FH_KMSG:
|
|
||||||
fh = cnew (fhandler_mailslot);
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -800,26 +800,6 @@ exception::handle (EXCEPTION_RECORD *e, exception_list *frame, CONTEXT *in,
|
||||||
return ExceptionContinueExecution;
|
return ExceptionContinueExecution;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* FIXME: Probably should be handled in signal processing code */
|
|
||||||
if ((NTSTATUS) e->ExceptionCode == STATUS_ACCESS_VIOLATION)
|
|
||||||
{
|
|
||||||
int error_code = 0;
|
|
||||||
if (si.si_code == SEGV_ACCERR) /* Address present */
|
|
||||||
error_code |= 1;
|
|
||||||
if (e->ExceptionInformation[0]) /* Write access */
|
|
||||||
error_code |= 2;
|
|
||||||
if (!me.inside_kernel (in)) /* User space */
|
|
||||||
error_code |= 4;
|
|
||||||
klog (LOG_INFO,
|
|
||||||
#ifdef __x86_64__
|
|
||||||
"%s[%d]: segfault at %011X rip %011X rsp %011X error %d",
|
|
||||||
#else
|
|
||||||
"%s[%d]: segfault at %08x rip %08x rsp %08x error %d",
|
|
||||||
#endif
|
|
||||||
__progname, myself->pid,
|
|
||||||
e->ExceptionInformation[1], in->_GR(ip), in->_GR(sp),
|
|
||||||
error_code);
|
|
||||||
}
|
|
||||||
cygwin_exception exc (framep, in, e);
|
cygwin_exception exc (framep, in, e);
|
||||||
si.si_cyg = (void *) &exc;
|
si.si_cyg = (void *) &exc;
|
||||||
/* POSIX requires that for SIGSEGV and SIGBUS, si_addr should be set to the
|
/* POSIX requires that for SIGSEGV and SIGBUS, si_addr should be set to the
|
||||||
|
|
|
@ -1261,35 +1261,6 @@ public:
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
class fhandler_mailslot : public fhandler_base_overlapped
|
|
||||||
{
|
|
||||||
POBJECT_ATTRIBUTES get_object_attr (OBJECT_ATTRIBUTES &, PUNICODE_STRING, int);
|
|
||||||
public:
|
|
||||||
fhandler_mailslot ();
|
|
||||||
int __reg2 fstat (struct stat *buf);
|
|
||||||
int open (int flags, mode_t mode = 0);
|
|
||||||
ssize_t __reg3 raw_write (const void *, size_t);
|
|
||||||
int ioctl (unsigned int cmd, void *);
|
|
||||||
select_record *select_read (select_stuff *);
|
|
||||||
|
|
||||||
fhandler_mailslot (void *) {}
|
|
||||||
|
|
||||||
void copyto (fhandler_base *x)
|
|
||||||
{
|
|
||||||
x->pc.free_strings ();
|
|
||||||
*reinterpret_cast<fhandler_mailslot *> (x) = *this;
|
|
||||||
x->reset (this);
|
|
||||||
}
|
|
||||||
|
|
||||||
fhandler_mailslot *clone (cygheap_types malloc_type = HEAP_FHANDLER)
|
|
||||||
{
|
|
||||||
void *ptr = (void *) ccalloc (malloc_type, 1, sizeof (fhandler_mailslot));
|
|
||||||
fhandler_mailslot *fh = new (ptr) fhandler_mailslot (ptr);
|
|
||||||
copyto (fh);
|
|
||||||
return fh;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
class fhandler_dev_raw: public fhandler_base
|
class fhandler_dev_raw: public fhandler_base
|
||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
|
@ -2645,7 +2616,6 @@ typedef union
|
||||||
char __dev_zero[sizeof (fhandler_dev_zero)];
|
char __dev_zero[sizeof (fhandler_dev_zero)];
|
||||||
char __disk_file[sizeof (fhandler_disk_file)];
|
char __disk_file[sizeof (fhandler_disk_file)];
|
||||||
char __fifo[sizeof (fhandler_fifo)];
|
char __fifo[sizeof (fhandler_fifo)];
|
||||||
char __mailslot[sizeof (fhandler_mailslot)];
|
|
||||||
char __netdrive[sizeof (fhandler_netdrive)];
|
char __netdrive[sizeof (fhandler_netdrive)];
|
||||||
char __nodevice[sizeof (fhandler_nodevice)];
|
char __nodevice[sizeof (fhandler_nodevice)];
|
||||||
char __pipe[sizeof (fhandler_pipe)];
|
char __pipe[sizeof (fhandler_pipe)];
|
||||||
|
|
|
@ -1,190 +0,0 @@
|
||||||
/* fhandler_mailslot.cc. See fhandler.h for a description of the fhandler classes.
|
|
||||||
|
|
||||||
This file is part of Cygwin.
|
|
||||||
|
|
||||||
This software is a copyrighted work licensed under the terms of the
|
|
||||||
Cygwin license. Please consult the file "CYGWIN_LICENSE" for
|
|
||||||
details. */
|
|
||||||
|
|
||||||
#include "winsup.h"
|
|
||||||
|
|
||||||
#include "cygerrno.h"
|
|
||||||
#include "security.h"
|
|
||||||
#include "path.h"
|
|
||||||
#include "fhandler.h"
|
|
||||||
#include "dtable.h"
|
|
||||||
#include "cygheap.h"
|
|
||||||
#include "ntdll.h"
|
|
||||||
#include "shared_info.h"
|
|
||||||
#include "tls_pbuf.h"
|
|
||||||
|
|
||||||
/**********************************************************************/
|
|
||||||
/* fhandler_mailslot */
|
|
||||||
|
|
||||||
fhandler_mailslot::fhandler_mailslot ()
|
|
||||||
: fhandler_base_overlapped ()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
int __reg2
|
|
||||||
fhandler_mailslot::fstat (struct stat *buf)
|
|
||||||
{
|
|
||||||
debug_printf ("here");
|
|
||||||
|
|
||||||
fhandler_base_overlapped::fstat (buf);
|
|
||||||
if (is_auto_device ())
|
|
||||||
{
|
|
||||||
buf->st_mode = S_IFCHR | S_IRUSR | S_IWUSR;
|
|
||||||
buf->st_uid = geteuid32 ();
|
|
||||||
buf->st_gid = getegid32 ();
|
|
||||||
buf->st_nlink = 1;
|
|
||||||
buf->st_blksize = PREFERRED_IO_BLKSIZE;
|
|
||||||
time_as_timestruc_t (&buf->st_ctim);
|
|
||||||
buf->st_atim = buf->st_mtim = buf->st_birthtim = buf->st_ctim;
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
POBJECT_ATTRIBUTES
|
|
||||||
fhandler_mailslot::get_object_attr (OBJECT_ATTRIBUTES &attr,
|
|
||||||
PUNICODE_STRING path,
|
|
||||||
int flags)
|
|
||||||
{
|
|
||||||
|
|
||||||
RtlCopyUnicodeString (path, pc.get_nt_native_path ());
|
|
||||||
RtlAppendUnicodeStringToString (path, &cygheap->installation_key);
|
|
||||||
InitializeObjectAttributes (&attr, path,
|
|
||||||
OBJ_CASE_INSENSITIVE
|
|
||||||
| (flags & O_CLOEXEC ? 0 : OBJ_INHERIT),
|
|
||||||
NULL, NULL);
|
|
||||||
return &attr;
|
|
||||||
}
|
|
||||||
|
|
||||||
int
|
|
||||||
fhandler_mailslot::open (int flags, mode_t mode)
|
|
||||||
{
|
|
||||||
int res = 0;
|
|
||||||
NTSTATUS status;
|
|
||||||
IO_STATUS_BLOCK io;
|
|
||||||
OBJECT_ATTRIBUTES attr;
|
|
||||||
HANDLE x;
|
|
||||||
LARGE_INTEGER timeout;
|
|
||||||
tmp_pathbuf tp;
|
|
||||||
UNICODE_STRING path;
|
|
||||||
|
|
||||||
tp.u_get (&path);
|
|
||||||
|
|
||||||
switch (flags & O_ACCMODE)
|
|
||||||
{
|
|
||||||
case O_RDONLY: /* Server */
|
|
||||||
timeout.QuadPart = (flags & O_NONBLOCK) ? 0LL : 0x8000000000000000LL;
|
|
||||||
status = NtCreateMailslotFile (&x, GENERIC_READ | SYNCHRONIZE,
|
|
||||||
get_object_attr (attr, &path, flags),
|
|
||||||
&io, FILE_SYNCHRONOUS_IO_NONALERT,
|
|
||||||
0, 0, &timeout);
|
|
||||||
if (!NT_SUCCESS (status))
|
|
||||||
{
|
|
||||||
/* FIXME: It's not possible to open the read side of an existing
|
|
||||||
mailslot again. You'll get a handle, but using it in ReadFile
|
|
||||||
returns ERROR_INVALID_PARAMETER. On the other hand,
|
|
||||||
NtCreateMailslotFile returns with STATUS_OBJECT_NAME_EXISTS if
|
|
||||||
the mailslot has been created already.
|
|
||||||
So this is an exclusive open for now. *Duplicating* read side
|
|
||||||
handles works, though, so it might be an option to duplicate
|
|
||||||
the handle from the first process to the current process for
|
|
||||||
opening the mailslot. */
|
|
||||||
#if 0
|
|
||||||
if (status != STATUS_OBJECT_NAME_COLLISION)
|
|
||||||
{
|
|
||||||
__seterrno_from_nt_status (status);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
status = NtOpenFile (&x, GENERIC_READ | SYNCHRONIZE,
|
|
||||||
get_object_attr (attr, &path, flags), &io,
|
|
||||||
FILE_SHARE_VALID_FLAGS,
|
|
||||||
FILE_SYNCHRONOUS_IO_NONALERT);
|
|
||||||
#endif
|
|
||||||
if (!NT_SUCCESS (status))
|
|
||||||
{
|
|
||||||
__seterrno_from_nt_status (status);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
set_io_handle (x);
|
|
||||||
set_flags (flags, O_BINARY);
|
|
||||||
res = 1;
|
|
||||||
set_open_status ();
|
|
||||||
break;
|
|
||||||
case O_WRONLY: /* Client */
|
|
||||||
/* The client is the DLL exclusively. Don't allow opening from
|
|
||||||
application code. */
|
|
||||||
extern fhandler_mailslot *dev_kmsg;
|
|
||||||
if (this != dev_kmsg)
|
|
||||||
{
|
|
||||||
set_errno (EPERM); /* As on Linux. */
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
status = NtOpenFile (&x, GENERIC_WRITE | SYNCHRONIZE,
|
|
||||||
get_object_attr (attr, &path, flags), &io,
|
|
||||||
FILE_SHARE_VALID_FLAGS, 0);
|
|
||||||
if (!NT_SUCCESS (status))
|
|
||||||
{
|
|
||||||
__seterrno_from_nt_status (status);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
set_io_handle (x);
|
|
||||||
set_flags (flags, O_BINARY);
|
|
||||||
res = 1;
|
|
||||||
set_open_status ();
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
set_errno (EINVAL);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return res;
|
|
||||||
}
|
|
||||||
|
|
||||||
ssize_t __reg3
|
|
||||||
fhandler_mailslot::raw_write (const void *ptr, size_t len)
|
|
||||||
{
|
|
||||||
/* Check for 425/426 byte weirdness */
|
|
||||||
if (len == 425 || len == 426)
|
|
||||||
{
|
|
||||||
char buf[427];
|
|
||||||
buf[425] = buf[426] = '\0';
|
|
||||||
memcpy (buf, ptr, len);
|
|
||||||
return raw_write (buf, 427);
|
|
||||||
}
|
|
||||||
return fhandler_base_overlapped::raw_write (ptr, len);
|
|
||||||
}
|
|
||||||
|
|
||||||
int
|
|
||||||
fhandler_mailslot::ioctl (unsigned int cmd, void *buf)
|
|
||||||
{
|
|
||||||
int res = -1;
|
|
||||||
NTSTATUS status;
|
|
||||||
IO_STATUS_BLOCK io;
|
|
||||||
|
|
||||||
switch (cmd)
|
|
||||||
{
|
|
||||||
case FIONBIO:
|
|
||||||
{
|
|
||||||
FILE_MAILSLOT_SET_INFORMATION fmsi;
|
|
||||||
fmsi.ReadTimeout.QuadPart = buf ? 0LL : 0x8000000000000000LL;
|
|
||||||
status = NtSetInformationFile (get_handle (), &io, &fmsi, sizeof fmsi,
|
|
||||||
FileMailslotSetInformation);
|
|
||||||
if (!NT_SUCCESS (status))
|
|
||||||
{
|
|
||||||
debug_printf ("NtSetInformationFile (%X): %p",
|
|
||||||
fmsi.ReadTimeout.QuadPart, status);
|
|
||||||
__seterrno_from_nt_status (status);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/*FALLTHRU*/
|
|
||||||
default:
|
|
||||||
res = fhandler_base_overlapped::ioctl (cmd, buf);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return res;
|
|
||||||
}
|
|
|
@ -13,7 +13,9 @@ details. */
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
|
|
||||||
#define _PATH_LOG "/dev/log"
|
#define _PATH_LOG "/dev/log"
|
||||||
|
#if 0 /* Removed post 2.10 */
|
||||||
#define _PATH_KLOG "/dev/kmsg"
|
#define _PATH_KLOG "/dev/kmsg"
|
||||||
|
#endif
|
||||||
|
|
||||||
#define LOG_EMERG 0
|
#define LOG_EMERG 0
|
||||||
#define LOG_ALERT 1
|
#define LOG_ALERT 1
|
||||||
|
|
|
@ -1724,121 +1724,3 @@ fhandler_windows::select_except (select_stuff *ss)
|
||||||
s->windows_handle = true;
|
s->windows_handle = true;
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
|
||||||
peek_mailslot (select_record *me, bool)
|
|
||||||
{
|
|
||||||
HANDLE h;
|
|
||||||
set_handle_or_return_if_not_open (h, me);
|
|
||||||
|
|
||||||
if (me->read_selected && me->read_ready)
|
|
||||||
return 1;
|
|
||||||
DWORD msgcnt = 0;
|
|
||||||
if (!GetMailslotInfo (h, NULL, NULL, &msgcnt, NULL))
|
|
||||||
{
|
|
||||||
me->except_ready = true;
|
|
||||||
select_printf ("mailslot %d(%p) error %E", me->fd, h);
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
if (msgcnt > 0)
|
|
||||||
{
|
|
||||||
me->read_ready = true;
|
|
||||||
select_printf ("mailslot %d(%p) ready", me->fd, h);
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
select_printf ("mailslot %d(%p) not ready", me->fd, h);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int
|
|
||||||
verify_mailslot (select_record *me, fd_set *rfds, fd_set *wfds,
|
|
||||||
fd_set *efds)
|
|
||||||
{
|
|
||||||
return peek_mailslot (me, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int start_thread_mailslot (select_record *me, select_stuff *stuff);
|
|
||||||
|
|
||||||
static DWORD WINAPI
|
|
||||||
thread_mailslot (void *arg)
|
|
||||||
{
|
|
||||||
select_mailslot_info *mi = (select_mailslot_info *) arg;
|
|
||||||
bool gotone = false;
|
|
||||||
DWORD sleep_time = 0;
|
|
||||||
|
|
||||||
for (;;)
|
|
||||||
{
|
|
||||||
select_record *s = mi->start;
|
|
||||||
while ((s = s->next))
|
|
||||||
if (s->startup == start_thread_mailslot)
|
|
||||||
{
|
|
||||||
if (peek_mailslot (s, true))
|
|
||||||
gotone = true;
|
|
||||||
if (mi->stop_thread)
|
|
||||||
{
|
|
||||||
select_printf ("stopping");
|
|
||||||
goto out;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/* Paranoid check */
|
|
||||||
if (mi->stop_thread)
|
|
||||||
{
|
|
||||||
select_printf ("stopping from outer loop");
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
if (gotone)
|
|
||||||
break;
|
|
||||||
Sleep (sleep_time >> 3);
|
|
||||||
if (sleep_time < 80)
|
|
||||||
++sleep_time;
|
|
||||||
}
|
|
||||||
out:
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int
|
|
||||||
start_thread_mailslot (select_record *me, select_stuff *stuff)
|
|
||||||
{
|
|
||||||
if (stuff->device_specific_mailslot)
|
|
||||||
{
|
|
||||||
me->h = *((select_mailslot_info *) stuff->device_specific_mailslot)->thread;
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
select_mailslot_info *mi = new select_mailslot_info;
|
|
||||||
mi->start = &stuff->start;
|
|
||||||
mi->stop_thread = false;
|
|
||||||
mi->thread = new cygthread (thread_mailslot, mi, "mailsel");
|
|
||||||
me->h = *mi->thread;
|
|
||||||
if (!me->h)
|
|
||||||
return 0;
|
|
||||||
stuff->device_specific_mailslot = mi;
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
mailslot_cleanup (select_record *, select_stuff *stuff)
|
|
||||||
{
|
|
||||||
select_mailslot_info *mi = (select_mailslot_info *) stuff->device_specific_mailslot;
|
|
||||||
if (!mi)
|
|
||||||
return;
|
|
||||||
if (mi->thread)
|
|
||||||
{
|
|
||||||
mi->stop_thread = true;
|
|
||||||
mi->thread->detach ();
|
|
||||||
}
|
|
||||||
delete mi;
|
|
||||||
stuff->device_specific_mailslot = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
select_record *
|
|
||||||
fhandler_mailslot::select_read (select_stuff *ss)
|
|
||||||
{
|
|
||||||
select_record *s = ss->start.next;
|
|
||||||
s->startup = start_thread_mailslot;
|
|
||||||
s->peek = peek_mailslot;
|
|
||||||
s->verify = verify_mailslot;
|
|
||||||
s->cleanup = mailslot_cleanup;
|
|
||||||
s->read_selected = true;
|
|
||||||
s->read_ready = false;
|
|
||||||
return s;
|
|
||||||
}
|
|
||||||
|
|
|
@ -64,11 +64,6 @@ struct select_serial_info: public select_info
|
||||||
select_serial_info (): select_info () {}
|
select_serial_info (): select_info () {}
|
||||||
};
|
};
|
||||||
|
|
||||||
struct select_mailslot_info: public select_info
|
|
||||||
{
|
|
||||||
select_mailslot_info (): select_info () {}
|
|
||||||
};
|
|
||||||
|
|
||||||
class select_stuff
|
class select_stuff
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
@ -88,7 +83,6 @@ public:
|
||||||
select_pipe_info *device_specific_pipe;
|
select_pipe_info *device_specific_pipe;
|
||||||
select_socket_info *device_specific_socket;
|
select_socket_info *device_specific_socket;
|
||||||
select_serial_info *device_specific_serial;
|
select_serial_info *device_specific_serial;
|
||||||
select_mailslot_info *device_specific_mailslot;
|
|
||||||
|
|
||||||
bool test_and_set (int, fd_set *, fd_set *, fd_set *);
|
bool test_and_set (int, fd_set *, fd_set *, fd_set *);
|
||||||
int poll (fd_set *, fd_set *, fd_set *);
|
int poll (fd_set *, fd_set *, fd_set *);
|
||||||
|
@ -100,8 +94,7 @@ public:
|
||||||
windows_used (false), start (0),
|
windows_used (false), start (0),
|
||||||
device_specific_pipe (NULL),
|
device_specific_pipe (NULL),
|
||||||
device_specific_socket (NULL),
|
device_specific_socket (NULL),
|
||||||
device_specific_serial (NULL),
|
device_specific_serial (NULL) {}
|
||||||
device_specific_mailslot (NULL) {}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
extern "C" int cygwin_select (int , fd_set *, fd_set *, fd_set *,
|
extern "C" int cygwin_select (int , fd_set *, fd_set *, fd_set *,
|
||||||
|
|
|
@ -457,38 +457,6 @@ syslog (int priority, const char *message, ...)
|
||||||
va_end (ap);
|
va_end (ap);
|
||||||
}
|
}
|
||||||
|
|
||||||
static NO_COPY muto klog_guard;
|
|
||||||
fhandler_mailslot *dev_kmsg;
|
|
||||||
|
|
||||||
extern "C" void
|
|
||||||
vklog (int priority, const char *message, va_list ap)
|
|
||||||
{
|
|
||||||
/* TODO: kernel messages are under our control entirely and they should
|
|
||||||
be quick. No playing with /dev/null, but a fixed upper size for now. */
|
|
||||||
char buf[2060]; /* 2048 + a prority */
|
|
||||||
if (!(priority & ~LOG_PRIMASK))
|
|
||||||
priority = LOG_KERN | LOG_PRI (priority);
|
|
||||||
__small_sprintf (buf, "<%d>", priority);
|
|
||||||
__small_vsprintf (buf + strlen (buf), message, ap);
|
|
||||||
klog_guard.init ("klog_guard")->acquire ();
|
|
||||||
if (!dev_kmsg)
|
|
||||||
dev_kmsg = (fhandler_mailslot *) build_fh_name ("/dev/kmsg");
|
|
||||||
if (dev_kmsg && !dev_kmsg->get_handle ())
|
|
||||||
dev_kmsg->open (O_WRONLY, 0);
|
|
||||||
if (dev_kmsg && dev_kmsg->get_handle ())
|
|
||||||
dev_kmsg->write (buf, strlen (buf) + 1);
|
|
||||||
klog_guard.release ();
|
|
||||||
}
|
|
||||||
|
|
||||||
extern "C" void
|
|
||||||
klog (int priority, const char *message, ...)
|
|
||||||
{
|
|
||||||
va_list ap;
|
|
||||||
va_start (ap, message);
|
|
||||||
vklog (priority, message, ap);
|
|
||||||
va_end (ap);
|
|
||||||
}
|
|
||||||
|
|
||||||
extern "C" void
|
extern "C" void
|
||||||
closelog (void)
|
closelog (void)
|
||||||
{
|
{
|
||||||
|
|
|
@ -223,8 +223,6 @@ int __small_swprintf (PWCHAR dst, const WCHAR *fmt, ...);
|
||||||
int __small_vswprintf (PWCHAR dst, const WCHAR *fmt, va_list ap);
|
int __small_vswprintf (PWCHAR dst, const WCHAR *fmt, va_list ap);
|
||||||
void multiple_cygwin_problem (const char *, uintptr_t, uintptr_t);
|
void multiple_cygwin_problem (const char *, uintptr_t, uintptr_t);
|
||||||
|
|
||||||
extern "C" void vklog (int priority, const char *message, va_list ap);
|
|
||||||
extern "C" void klog (int priority, const char *message, ...);
|
|
||||||
bool child_copy (HANDLE, bool, ...);
|
bool child_copy (HANDLE, bool, ...);
|
||||||
|
|
||||||
class path_conv;
|
class path_conv;
|
||||||
|
|
Loading…
Reference in New Issue