2002-01-19 20:58:41 +00:00
|
|
|
/* sysutils.h - System utility functions for Gnupg
|
|
|
|
* Copyright (C) 2002 Free Software Foundation, Inc.
|
|
|
|
*
|
|
|
|
* This file is part of GnuPG.
|
|
|
|
*
|
|
|
|
* GnuPG is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
2007-07-04 19:49:40 +00:00
|
|
|
* the Free Software Foundation; either version 3 of the License, or
|
2002-01-19 20:58:41 +00:00
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* GnuPG is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
2007-07-04 19:49:40 +00:00
|
|
|
* along with this program; if not, see <http://www.gnu.org/licenses/>.
|
2002-01-19 20:58:41 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef GNUPG_COMMON_SYSUTILS_H
|
|
|
|
#define GNUPG_COMMON_SYSUTILS_H
|
|
|
|
|
2007-07-12 15:28:30 +00:00
|
|
|
/* Because we use system handles and not libc low level file
|
|
|
|
descriptors on W32, we need to declare them as HANDLE (which
|
|
|
|
actually is a plain pointer). This is required to eventually
|
|
|
|
support 64 bits Windows systems. */
|
|
|
|
#ifdef HAVE_W32_SYSTEM
|
|
|
|
typedef void *gnupg_fd_t;
|
|
|
|
#define GNUPG_INVALID_FD ((void*)(-1))
|
2007-10-01 14:48:39 +00:00
|
|
|
#define INT2FD(s) ((void *)(s))
|
|
|
|
#define FD2INT(h) ((unsigned int)(h))
|
2007-07-12 15:28:30 +00:00
|
|
|
#else
|
|
|
|
typedef int gnupg_fd_t;
|
|
|
|
#define GNUPG_INVALID_FD (-1)
|
2007-10-01 14:48:39 +00:00
|
|
|
#define INT2FD(s) (s)
|
|
|
|
#define FD2INT(h) (h)
|
2007-07-12 15:28:30 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
|
2002-01-19 20:58:41 +00:00
|
|
|
void trap_unaligned (void);
|
|
|
|
int disable_core_dumps (void);
|
2004-05-11 09:54:52 +00:00
|
|
|
int enable_core_dumps (void);
|
2002-01-19 20:58:41 +00:00
|
|
|
const unsigned char *get_session_marker (size_t *rlen);
|
2007-06-26 13:48:44 +00:00
|
|
|
/*int check_permissions (const char *path,int extension,int checkonly);*/
|
2007-06-20 11:16:42 +00:00
|
|
|
void gnupg_sleep (unsigned int seconds);
|
2007-07-12 15:28:30 +00:00
|
|
|
int translate_sys2libc_fd (gnupg_fd_t fd, int for_write);
|
|
|
|
int translate_sys2libc_fd_int (int fd, int for_write);
|
2007-08-22 10:55:07 +00:00
|
|
|
FILE *gnupg_tmpfile (void);
|
2007-12-03 13:05:15 +00:00
|
|
|
void gnupg_reopen_std (const char *pgmname);
|
2008-02-14 19:50:10 +00:00
|
|
|
void gnupg_allow_set_foregound_window (pid_t pid);
|
2007-07-12 15:28:30 +00:00
|
|
|
|
2002-01-19 20:58:41 +00:00
|
|
|
|
2004-12-15 14:15:54 +00:00
|
|
|
#ifdef HAVE_W32_SYSTEM
|
2013-07-03 13:29:47 +02:00
|
|
|
void *w32_get_user_sid (void);
|
2004-12-20 16:17:25 +00:00
|
|
|
|
2013-07-03 13:29:47 +02:00
|
|
|
# include "../jnlib/w32help.h"
|
2004-12-20 16:17:25 +00:00
|
|
|
|
2004-12-15 14:15:54 +00:00
|
|
|
#endif /*HAVE_W32_SYSTEM*/
|
2002-01-19 20:58:41 +00:00
|
|
|
|
|
|
|
#endif /*GNUPG_COMMON_SYSUTILS_H*/
|