Movatterモバイル変換


[0]ホーム

URL:


GitHub

C Standard Library

Base.Libc.mallocFunction
malloc(size::Integer) -> Ptr{Cvoid}

Callmalloc from the C standard library.

source
Base.Libc.callocFunction
calloc(num::Integer, size::Integer) -> Ptr{Cvoid}

Callcalloc from the C standard library.

source
Base.Libc.reallocFunction
realloc(addr::Ptr, size::Integer) -> Ptr{Cvoid}

Callrealloc from the C standard library.

See warning in the documentation forfree regarding only using this on memory originally obtained frommalloc.

source
Base.memcpyFunction
memcpy(dst::Ptr, src::Ptr, n::Integer) -> Ptr{Cvoid}

Callmemcpy from the C standard library.

Julia 1.10

Support formemcpy requires at least Julia 1.10.

source
Base.memmoveFunction
memmove(dst::Ptr, src::Ptr, n::Integer) -> Ptr{Cvoid}

Callmemmove from the C standard library.

Julia 1.10

Support formemmove requires at least Julia 1.10.

source
Base.memsetFunction
memset(dst::Ptr, val, n::Integer) -> Ptr{Cvoid}

Callmemset from the C standard library.

Julia 1.10

Support formemset requires at least Julia 1.10.

source
Base.memcmpFunction
memcmp(a::Ptr, b::Ptr, n::Integer) -> Int

Callmemcmp from the C standard library.

Julia 1.10

Support formemcmp requires at least Julia 1.9.

source
Base.Libc.freeFunction
free(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.

source
Base.Libc.errnoFunction
errno([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.

source
Base.Libc.strerrorFunction
strerror(n=errno())

Convert a system call error code to a descriptive string

source
Base.Libc.GetLastErrorFunction
GetLastError()

Call the Win32GetLastError function [only available on Windows].

source
Base.Libc.FormatMessageFunction
FormatMessage(n=GetLastError())

Convert a Win32 system call error code to a descriptive string [only available on Windows].

source
Base.Libc.timeMethod
time(t::TmStruct) -> Float64

Converts aTmStruct struct to a number of seconds since the epoch.

source
Base.Libc.strftimeFunction
strftime([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.

source
Base.Libc.strptimeFunction
strptime([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.

source
Base.Libc.TmStructType
TmStruct([seconds])

Convert a number of seconds since the epoch to broken-down format, with fieldssec,min,hour,mday,month,year,wday,yday, andisdst.

source
Base.Libc.FILEType
FILE(::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"
source
Base.Libc.flush_cstdioFunction
flush_cstdio()

Flushes the Cstdout andstderr streams (which may have been written to by external C code).

source
Base.Libc.systemsleepFunction
systemsleep(s::Real)

Suspends execution fors seconds. This function does not yield to Julia's scheduler and therefore blocks the Julia thread that it is running on for the duration of the sleep time.

See alsosleep.

source
Base.Libc.mkfifoFunction
mkfifo(path::AbstractString, [mode::Integer]) -> path

Make a FIFO special file (a named pipe) atpath. Returnpath as-is on success.

mkfifo is supported only in Unix platforms.

Julia 1.11

mkfifo requires at least Julia 1.11.

source

Settings


This document was generated withDocumenter.jl version 1.8.0 onWednesday 9 July 2025. Using Julia version 1.11.6.


[8]ページ先頭

©2009-2025 Movatter.jp