newlib/winsup/cygwin/wincap.h

109 lines
3.9 KiB
C
Raw Normal View History

/* wincap.h: Header for OS capability class.
Copyright 2001 Red Hat, Inc.
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. */
#ifndef _WINCAP_H
#define _WINCAP_H
struct wincaps
2001-11-05 07:09:15 +01:00
{
DWORD lock_file_highword;
DWORD chunksize;
int shared;
unsigned is_winnt : 1;
unsigned access_denied_on_delete : 1;
unsigned has_delete_on_close : 1;
unsigned has_page_guard : 1;
unsigned has_security : 1;
unsigned has_security_descriptor_control : 1;
unsigned has_get_process_times : 1;
unsigned has_specific_access_rights : 1;
unsigned has_lseek_bug : 1;
unsigned has_lock_file_ex : 1;
unsigned has_signal_object_and_wait : 1;
unsigned has_eventlog : 1;
unsigned has_ip_helper_lib : 1;
unsigned has_set_handle_information : 1;
unsigned has_set_handle_information_on_console_handles: 1;
unsigned supports_smp : 1;
unsigned map_view_of_file_ex_sucks : 1;
unsigned altgr_is_ctrl_alt : 1;
unsigned has_physical_mem_access : 1;
unsigned has_working_copy_on_write : 1;
unsigned share_mmaps_only_by_name : 1;
unsigned virtual_protect_works_on_shared_pages : 1;
unsigned has_hard_links : 1;
unsigned can_open_directories : 1;
unsigned has_move_file_ex : 1;
unsigned has_negative_pids : 1;
unsigned has_unreliable_pipes : 1;
unsigned has_try_enter_critical_section : 1;
unsigned has_raw_devices : 1;
unsigned has_valid_processorlevel : 1;
* cygwin.din (fstat64): New symbol. (ftruncate64): Ditto. (lseek64): Ditto. (lstat64): Ditto. (mmap64): Ditto. (seekdir64): Ditto. (stat64): Ditto. (telldir64): Ditto. (truncate64): Ditto. * dir.cc (telldir64): New function. (telldir): Call telldir64(). (seekdir64): New function. (seekdir): Call seekdir64(). * fhandler.h: Redefine all methods using __off32_t to use __off64_t. * fhandler.cc: Use __off64_t and struct __stat64 throughout. * fhandler_clipboard.cc: Ditto. * fhandler_disk_file.cc: Ditto. * fhandler_dsp.cc: Ditto. * fhandler_floppy.cc: Ditto. * fhandler_mem.cc: Ditto. * fhandler_random.cc: Ditto. * fhandler_socket.cc: Ditto. * fhandler_tape.cc: Ditto. * fhandler_zero.cc: Ditto. * pipe.cc: Ditto. * glob.c: Ditto, call lstat64 and stat64 in Cygwin. * mmap.cc: Use __off64_t throughout. (mmap64): New function. * sec_acl.cc (acl_worker): Use struct __stat64, call stat64 and lstat64. * syscalls.cc (lseek64): New function. (stat64_to_stat32): Ditto. (fstat64): Ditto. (stat64): Ditto. (lstat64): Ditto. (ftruncate64): Ditto. (truncate64): Ditto. (_fstat): Call fstat64. (_stat): Call stat64. (cygwin_lstat): Rename to avoid declaration problem. Call lstat64. (stat_worker): Use struct __stat64. (access): Ditto. (ftruncate): Call ftruncate64. (truncate): Call truncate64. * wincap.cc: Set flag has_64bit_file_access appropriately. * wincap.h: Add flag has_64bit_file_access. * winsup.h (ILLEGAL_SEEK): Define as __off64_t. (stat_dev): Declare using struct __stat64. (stat_worker): Ditto. * include/cygwin/stat.h (struct __stat32): Define if compiling Cygwin. (struct __stat64): Ditto. (struct stat): Revert definition with explicitly sized datatypes. Eliminate sized field names. * include/cygwin/types.h (blksize_t): New type. (__blkcnt32_t): Ditto. (__blkcnt64_t): Ditto. (blkcnt_t): Ditto.
2002-02-25 18:47:51 +01:00
unsigned has_64bit_file_access : 1;
};
class wincapc
{
OSVERSIONINFO version;
char osnam[40];
void *caps;
public:
wincapc (): caps (NULL) {}
void init ();
void set_chunksize (DWORD nchunksize);
2001-11-05 07:09:15 +01:00
const char *osname () const { return osnam; }
#define IMPLEMENT(cap) cap() const { return ((wincaps *)this->caps)->cap; }
DWORD IMPLEMENT (lock_file_highword)
DWORD IMPLEMENT (chunksize)
int IMPLEMENT (shared)
bool IMPLEMENT (is_winnt)
bool IMPLEMENT (access_denied_on_delete)
bool IMPLEMENT (has_delete_on_close)
bool IMPLEMENT (has_page_guard)
bool IMPLEMENT (has_security)
bool IMPLEMENT (has_security_descriptor_control)
bool IMPLEMENT (has_get_process_times)
bool IMPLEMENT (has_specific_access_rights)
bool IMPLEMENT (has_lseek_bug)
bool IMPLEMENT (has_lock_file_ex)
bool IMPLEMENT (has_signal_object_and_wait)
bool IMPLEMENT (has_eventlog)
bool IMPLEMENT (has_ip_helper_lib)
bool IMPLEMENT (has_set_handle_information)
bool IMPLEMENT (has_set_handle_information_on_console_handles)
bool IMPLEMENT (supports_smp)
bool IMPLEMENT (map_view_of_file_ex_sucks)
bool IMPLEMENT (altgr_is_ctrl_alt)
bool IMPLEMENT (has_physical_mem_access)
bool IMPLEMENT (has_working_copy_on_write)
bool IMPLEMENT (share_mmaps_only_by_name)
bool IMPLEMENT (virtual_protect_works_on_shared_pages)
bool IMPLEMENT (has_hard_links)
bool IMPLEMENT (can_open_directories)
bool IMPLEMENT (has_move_file_ex)
bool IMPLEMENT (has_negative_pids)
bool IMPLEMENT (has_unreliable_pipes)
bool IMPLEMENT (has_try_enter_critical_section)
bool IMPLEMENT (has_raw_devices)
bool IMPLEMENT (has_valid_processorlevel)
* cygwin.din (fstat64): New symbol. (ftruncate64): Ditto. (lseek64): Ditto. (lstat64): Ditto. (mmap64): Ditto. (seekdir64): Ditto. (stat64): Ditto. (telldir64): Ditto. (truncate64): Ditto. * dir.cc (telldir64): New function. (telldir): Call telldir64(). (seekdir64): New function. (seekdir): Call seekdir64(). * fhandler.h: Redefine all methods using __off32_t to use __off64_t. * fhandler.cc: Use __off64_t and struct __stat64 throughout. * fhandler_clipboard.cc: Ditto. * fhandler_disk_file.cc: Ditto. * fhandler_dsp.cc: Ditto. * fhandler_floppy.cc: Ditto. * fhandler_mem.cc: Ditto. * fhandler_random.cc: Ditto. * fhandler_socket.cc: Ditto. * fhandler_tape.cc: Ditto. * fhandler_zero.cc: Ditto. * pipe.cc: Ditto. * glob.c: Ditto, call lstat64 and stat64 in Cygwin. * mmap.cc: Use __off64_t throughout. (mmap64): New function. * sec_acl.cc (acl_worker): Use struct __stat64, call stat64 and lstat64. * syscalls.cc (lseek64): New function. (stat64_to_stat32): Ditto. (fstat64): Ditto. (stat64): Ditto. (lstat64): Ditto. (ftruncate64): Ditto. (truncate64): Ditto. (_fstat): Call fstat64. (_stat): Call stat64. (cygwin_lstat): Rename to avoid declaration problem. Call lstat64. (stat_worker): Use struct __stat64. (access): Ditto. (ftruncate): Call ftruncate64. (truncate): Call truncate64. * wincap.cc: Set flag has_64bit_file_access appropriately. * wincap.h: Add flag has_64bit_file_access. * winsup.h (ILLEGAL_SEEK): Define as __off64_t. (stat_dev): Declare using struct __stat64. (stat_worker): Ditto. * include/cygwin/stat.h (struct __stat32): Define if compiling Cygwin. (struct __stat64): Ditto. (struct stat): Revert definition with explicitly sized datatypes. Eliminate sized field names. * include/cygwin/types.h (blksize_t): New type. (__blkcnt32_t): Ditto. (__blkcnt64_t): Ditto. (blkcnt_t): Ditto.
2002-02-25 18:47:51 +01:00
bool IMPLEMENT (has_64bit_file_access)
#undef IMPLEMENT
};
extern wincapc wincap;
#endif /* _WINCAP_H */