mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-02-01 03:53:33 +00:00
8c4cce043c
The following Lua APIs have been added: - IsDaemon() → bool - ProgramPidPath(str) The following Lua hooks have been added: - OnClientConnection(ip:int,port:int,serverip:int,serverport:int) → bool - OnProcessCreate(pid:int,ip:int,port:int,serverip:int,serverport:int) - OnProcessDestroy(pid:int) - OnServerStart() - OnServerStop() - OnWorkerStart() - OnWorkerStop() redbean now does a better job at applying gzip on the fly from the local filesystem, using a streaming chunked api with constant memory, which is useful for doing things like serving a 4gb text file off NFS, and having it start transmitting in milliseconds. redbean will also compute entropy on the beginnings of files to determine if compression is profitable. This change pays off technical debts relating to memory, such as relying on exit() to free() allocations. That's now mostly fixed so it should be easier now to spot memory leaks in malloc traces. This change also fixes bugs and makes improvements to our SSL support. Uniprocess mode failed handshakes are no longer an issue. Token Alpn is offered so curl -v looks less weird. Hybrid SSL certificate loading is now smarter about naming conflicts. Self-signed CA root anchors will no longer be delivered to the client during the handshake.
33 lines
1.5 KiB
C
33 lines
1.5 KiB
C
#ifndef COSMOPOLITAN_LIBC_RAND_RAND_H_
|
|
#define COSMOPOLITAN_LIBC_RAND_RAND_H_
|
|
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
|
COSMOPOLITAN_C_START_
|
|
/*───────────────────────────────────────────────────────────────────────────│─╗
|
|
│ cosmopolitan § random ─╬─│┼
|
|
╚────────────────────────────────────────────────────────────────────────────│*/
|
|
|
|
#define RAND_MAX __INT_MAX__
|
|
void srand(uint64_t) nothrow nocallback;
|
|
int rand(void) nothrow nocallback;
|
|
uint64_t rand64(void) nothrow nocallback;
|
|
double poz(double);
|
|
double pochisq(double, int);
|
|
void rt_init(int);
|
|
void rt_add(void *, int);
|
|
void rt_end(double *, double *, double *, double *, double *);
|
|
void *rngset(void *, size_t, uint64_t (*)(void), size_t) paramsnonnull();
|
|
char *strfry(char *);
|
|
int getentropy(void *, size_t);
|
|
ssize_t getrandom(void *, size_t, unsigned);
|
|
uint64_t rdrand(void);
|
|
uint64_t rdseed(void);
|
|
float randf(void);
|
|
char *initstate(unsigned, char *, size_t);
|
|
char *setstate(char *);
|
|
long random(void);
|
|
void srandom(unsigned);
|
|
double MeasureEntropy(const char *, size_t);
|
|
|
|
COSMOPOLITAN_C_END_
|
|
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
|
#endif /* COSMOPOLITAN_LIBC_RAND_RAND_H_ */
|