summary refs log tree commit diff
path: root/compat.h
blob: d471a8fa358f87dca35b01a67de5a35495297bfe (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/* Copyright (C) 2019  C. McEnroe <june@causal.agency>
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program 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
 * along with this program.  If not, see <https://www.gnu.org/licenses/>.
 */

#include <stdint.h>
#include <stdlib.h>

// libcrypto defines these functions if libc doesn't.
void explicit_bzero(void *b, size_t len);
#ifndef strlcpy
size_t strlcpy(char *restrict dst, const char *restrict src, size_t dstsize);
size_t strlcat(char *restrict dst, const char *restrict src, size_t dstsize);
#endif
uint32_t arc4random(void);
void arc4random_buf(void *buf, size_t nbytes);
uint32_t arc4random_uniform(uint32_t upper_bound);

// The default value of SO_RCVLOWAT is 1 anyway...
#ifndef SO_NOSIGPIPE
#define SO_NOSIGPIPE SO_RCVLOWAT
#endif

#ifndef SIGINFO
#define SIGINFO SIGUSR2
#endif
af6dc8b02ddebf0e73&follow=1'>Enable diff.colorMovedJune McEnroe 2021-01-10Set less search case-insensitiveJune McEnroe 2021-01-10Set EXINITJune McEnroe 2021-01-09Add c -t flag to print expression typeJune McEnroe 2021-01-05Update taglineJune McEnroeid=56cd2bc2943bdfe8407053aa81b745ac8d2b6b75&follow=1'>Include sys/types.h in wake.cJune McEnroe 2017-09-06Move C file description commentsJune McEnroe Comments are ugly this is why I don't put them in my code ;) 2017-09-06Fix bin/Makefile FreeBSD compatibilityJune McEnroe Have to use the same generic rule as sys.mk so it replaces it. Otherwise it only uses the one in sys.mk. 2017-09-06Remove C code from link scriptJune McEnroe 2017-09-06Move C code to bin, Makefile, AGPLJune McEnroe 2017-09-06Rename curtis -> homeJune McEnroe Why the heck did I do this? 2017-09-05Pass final NULL to execlpJune McEnroe 2017-09-05Add watch.cJune McEnroe 2017-09-02Remove Scala highlightingJune McEnroe 2017-08-31Fix Linux console Tarmak 3June McEnroe Wow oops. 2017-08-31Use Tarmak 3 on Linux consoleJune McEnroe 2017-08-25Install ddateJune McEnroe 2017-08-19Move nethack options to envJune McEnroe 2017-08-17Remove scala syntax fileJune McEnroe 2017-08-06Add wakeJune McEnroe That payload can appear anywhere within an ethernet frame. Wake-on-LAN is funny. 2017-08-04Use $() in install.shJune McEnroe Something gave me the impression that sh did not like this, but it's specified by POSIX. 2017-08-02Create Code Tarmak 3 layoutJune McEnroe 2017-07-31Add tupJune McEnroe 2017-07-31Use designated initializer for hnel tableJune McEnroe I did not know this syntax worked! 2017-07-30Add juneJune McEnroe 2017-07-30Play nethack as ValkyrieJune McEnroe 2017-07-28Add toggle to hnelJune McEnroe 2017-07-28Install slJune McEnroe 2017-07-25Add up, supJune McEnroe 2017-07-24Autopickup ringsJune McEnroe 2017-07-24Name dogJune McEnroe 2017-07-23Add nethackrcJune McEnroe 2017-07-23Remove useless setuid in briJune McEnroe Don't you think it would be better if the setuid bit only gave you permission to do it and didn't do it for you? 2017-07-23Clean up hnel a tiny bitJune McEnroe 2017-07-21Set window size in hnelJune McEnroe 2017-07-21Add hnelJune McEnroe 2017-07-19chmod 600 in dtchJune McEnroe