1
0
mirror of https://github.com/libssh2/libssh2.git synced 2026-10-24 03:48:58 +03:00
Files
libssh2/vms/libssh2_config.h
Viktor Szakats 8563c38383 build: assume POSIX gettimeofday() in fallback codepath, stop detecting it
The codebase no longer relies on `gettimeofday()`. It still serves as an
unconditional fallback in `ssh2_now()` on non-Windows, if no modern
alternative exists. Let us know if this causes an issue.

To simplify, make configure fast, and avoid the detection discrepancy
between autotools and cmake.

Follow-up to 0d998d16c0 #2494
Follow-up to 694d38e33e #2493
Follow-up to a43dc6d504 #2490
Follow-up to 04665fedff #2491
Follow-up to c97959e9b6 #2489
Follow-up to 9c421761bc #2341

Closes #2485
2026-08-03 03:54:47 +02:00

84 lines
2.3 KiB
C

/* Copyright (C) The libssh2 project and its contributors.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
#ifndef LIBSSH2_CONFIG_H
#ifdef __VMS
#define LIBSSH2_CONFIG_H
/* VMS specific libssh2_config.h
*/
#define ssize_t SSIZE_T
typedef unsigned int uint32_t;
typedef unsigned int socklen_t; /* missing in headers on VMS */
/* Have's */
#define HAVE_UNISTD_H
#define HAVE_INTTYPES_H
#define HAVE_UIO
#define HAVE_NETINET_IN_H
#define HAVE_ARPA_INET_H
#define POSIX_C_SOURCE
/* Enable the possibility of using tracing */
#define LIBSSH2DEBUG 1
/* For selection of proper block/unblock function in session.c */
#define HAVE_FIONBIO
#include <stropts.h>
/* In VMS TCP/IP Services and some BSD variants SO_STATE retrieves
* a bitmask revealing amongst others the blocking state of the
* socket. On VMS the bits are undocumented, but SS_NBIO
* works, I did not test the other bits. Below bitdefs are
* from Berkely source socketvar.h at
* https://ftp.fibranet.cat/UnixArchive/PDP-11/Trees/2.11BSD/sys/h/socketvar.h
* Socket state bits.
* #define SS_NOFDREF 0x001 no file table ref any more
* #define SS_ISCONNECTED 0x002 socket connected to a peer
* #define SS_ISCONNECTING 0x004 in process of connecting to peer
* #define SS_ISDISCONNECTING 0x008 in process of disconnecting
* #define SS_CANTSENDMORE 0x010 cannot send more data to peer
* #define SS_CANTRCVMORE 0x020 cannot receive more data from peer
* #define SS_RCVATMARK 0x040 at mark on input
* #define SS_PRIV 0x080 privileged for broadcast, raw...
* #define SS_NBIO 0x100 non-blocking ops
* #define SS_ASYNC 0x200 async i/o notify
*
*/
#ifdef SO_STATE
/* SO_STATE is defined in stropts.h by DECC
* When running on Multinet, SO_STATE renders a protocol
* not started error. Functionally this has no impact,
* apart from libssh2 not being able to restore the socket
* to the proper blocking/non-blocking state.
*/
#define SS_NBIO 0x100
#endif
/* Use OpenSSL */
#define LIBSSH2_OPENSSL 1
/* Compile in zlib support. We link against gnv$libzshr, as available
* from https://sourceforge.net/projects/vms-ports/files/.
*/
#define LIBSSH2_HAVE_ZLIB
#endif /* __VMS */
#endif /* LIBSSH2_CONFIG_H */