Base.Libc.malloc —FunctionBase.Libc.calloc —FunctionBase.Libc.realloc —FunctionBase.memcpy —FunctionBase.memmove —FunctionBase.memset —FunctionBase.memcmp —FunctionBase.Libc.free —Functionfree(addr::Ptr)Callfree from the C standard library. Only use this on memory obtained frommalloc, not on pointers retrieved from other C libraries.Ptr objects obtained from C libraries should be freed by the free functions defined in that library, to avoid assertion failures if multiplelibc libraries exist on the system.
Base.Libc.errno —Functionerrno([code])Get the value of the C library'serrno. If an argument is specified, it is used to set the value oferrno.
The value oferrno is only valid immediately after accall to a C library routine that sets it. Specifically, you cannot callerrno at the next prompt in a REPL, because lots of code is executed between prompts.
Base.Libc.strerror —FunctionBase.Libc.GetLastError —FunctionBase.Libc.FormatMessage —FunctionFormatMessage(n=GetLastError())Convert a Win32 system call error code to a descriptive string [only available on Windows].
sourceBase.Libc.time —MethodBase.Libc.strftime —Functionstrftime([format], time)Convert time, given as a number of seconds since the epoch or aTmStruct, to a formatted string using the given format. Supported formats are the same as those in the standard C library.
Base.Libc.strptime —Functionstrptime([format], timestr)Parse a formatted time string into aTmStruct giving the seconds, minute, hour, date, etc. Supported formats are the same as those in the standard C library. On some platforms, timezones will not be parsed correctly. If the result of this function will be passed totime to convert it to seconds since the epoch, theisdst field should be filled in manually. Setting it to-1 will tell the C library to use the current system settings to determine the timezone.
Base.Libc.TmStruct —TypeTmStruct([seconds])Convert a number of seconds since the epoch to broken-down format, with fieldssec,min,hour,mday,month,year,wday,yday, andisdst.
Base.Libc.FILE —TypeFILE(::Ptr)FILE(::IO)A libcFILE*, representing an opened file.
It can be passed as aPtr{FILE} argument toccall and also supportsseek,position andclose.
AFILE can be constructed from an ordinaryIO object, provided it is an open file. It must be closed afterward.
Examples
julia> using Base.Libcjulia> mktemp() do _, io # write to the temporary file using `puts(char*, FILE*)` from libc file = FILE(io) ccall(:fputs, Cint, (Cstring, Ptr{FILE}), "hello world", file) close(file) # read the file again seek(io, 0) read(io, String) end"hello world"sourceBase.Libc.dup —Functiondup(src::RawFD[, target::RawFD])::RawFDDuplicate the file descriptorsrc so that the duplicate refers to the same OS resource (e.g. a file or socket). Atarget file descriptor may be optionally be passed to use for the new duplicate.
Base.Libc.flush_cstdio —Functionflush_cstdio()Flushes the Cstdout andstderr streams (which may have been written to by external C code).
Base.Libc.systemsleep —FunctionBase.Libc.mkfifo —Functionmkfifo(path::AbstractString, [mode::Integer]) -> pathMake a FIFO special file (a named pipe) atpath. Returnpath as-is on success.
mkfifo is supported only in Unix platforms.
Settings
This document was generated withDocumenter.jl version 1.16.0 onThursday 20 November 2025. Using Julia version 1.12.2.