hare

[hare] The Hare programming language
git clone https://git.torresjrjr.com/hare.git
Log | Files | Refs | README | LICENSE

libc.ha (408B)


      1 // SPDX-License-Identifier: MPL-2.0
      2 // (c) Hare authors <https://harelang.org>
      3 
      4 // Miscellaneous libc functions
      5 
      6 export @symbol("arc4random_buf") fn arc4random_buf(
      7 	buf: *opaque,
      8 	nbytes: size
      9 ) void;
     10 
     11 @symbol("ptsname") fn libc_ptsname(flides: int) *u8;
     12 
     13 export fn ptsname(flides: int) (*u8 | errno) = {
     14 	let res = libc_ptsname(flides);
     15 
     16 	if (res == null) {
     17 		return *__errno(): errno;
     18 	};
     19 	return res;
     20 };