C 標準函式庫

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

呼叫 C 標準函式庫中的 calloc

來源
Base.Libc.realloc函式
realloc(addr::Ptr, size::Integer) -> Ptr{Cvoid}

呼叫 C 標準函式庫中的 realloc

請參閱 free 文件中的警告,僅對最初從 malloc 取得的記憶體使用此函式。

來源
Base.memcpy函數
memcpy(dst::Ptr, src::Ptr, n::Integer) -> Ptr{Cvoid}

呼叫 C 標準函式庫中的 memcpy

Julia 1.10

支援 memcpy 至少需要 Julia 1.10。

來源
Base.memmove函數
memmove(dst::Ptr, src::Ptr, n::Integer) -> Ptr{Cvoid}

呼叫 C 標準函式庫中的 memmove

Julia 1.10

支援 memmove 至少需要 Julia 1.10。

來源
Base.memset函數
memset(dst::Ptr, val, n::Integer) -> Ptr{Cvoid}

呼叫 C 標準函式庫中的 memset

Julia 1.10

支援 memset 至少需要 Julia 1.10。

來源
Base.memcmp函數
memcmp(a::Ptr, b::Ptr, n::Integer) -> Int

呼叫 C 標準函式庫中的 memcmp

Julia 1.10

支援 memcmp 至少需要 Julia 1.9。

來源
Base.Libc.free函數
free(addr::Ptr)

呼叫 C 標準函式庫中的 free。僅對從 malloc 取得的記憶體使用此函數,不要對從其他 C 函式庫取得的指標使用。從 C 函式庫取得的 Ptr 物件應由該函式庫中定義的 free 函數釋放,以避免在系統中存在多個 libc 函式庫時發生斷言失敗。

來源
Base.Libc.errno函數
errno([code])

取得 C 函式庫的 errno 值。如果指定引數,則用來設定 errno 的值。

errno 的值僅在對設定它的 C 函式庫常式執行 ccall 之後才有效。具體來說,您無法在 REPL 中的下一提示字元呼叫 errno,因為在提示字元之間執行了大量程式碼。

來源
Base.Libc.FormatMessage函數
FormatMessage(n=GetLastError())

將 Win32 系統呼叫錯誤碼轉換為描述性字串 [僅在 Windows 上可用]。

來源
Base.Libc.time方法
time(t::TmStruct) -> Float64

TmStruct 結構轉換為自紀元以來的秒數。

來源
Base.Libc.strftime函數
strftime([format], time)

將時間(以自紀元以來的秒數或 TmStruct 表示)轉換為使用指定格式的格式化字串。支援的格式與標準 C 函式庫中的格式相同。

來源
Base.Libc.strptime函數
strptime([format], timestr)

將格式化時間字串解析為 TmStruct,提供秒、分、時、日期等。支援的格式與標準 C 函式庫中的格式相同。在某些平台上,時區無法正確解析。如果此函數的結果將傳遞給 time 以將其轉換為自紀元以來的秒數,則應手動填寫 isdst 欄位。將其設定為 -1 將告知 C 函式庫使用目前的系統設定來判斷時區。

來源
Base.Libc.TmStruct類型
TmStruct([seconds])

將自紀元以來的秒數轉換為分解格式,欄位包括 secminhourmdaymonthyearwdayydayisdst

來源
Base.Libc.systemsleep函數
systemsleep(s::Real)

暫停執行 s 秒。此函數不會讓出 Julia 的排程器,因此會在睡眠時間期間封鎖執行它的 Julia 執行緒。

另請參閱 sleep

來源