Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
0c8a009d
R
Rust
项目概览
int
/
Rust
大约 1 年 前同步成功
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
Rust
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
0c8a009d
编写于
11月 21, 2012
作者:
G
Graydon Hoare
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
libcore: fix build breakage on win32 stat.
上级
ef833d41
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
21 addition
and
3 deletion
+21
-3
src/libcore/libc.rs
src/libcore/libc.rs
+19
-2
src/libcore/path.rs
src/libcore/path.rs
+2
-1
未找到文件。
src/libcore/libc.rs
浏览文件 @
0c8a009d
...
...
@@ -13,10 +13,17 @@
* * ISO 9945:2001 / IEEE 1003.1-2001 ('POSIX:2001', 'SUSv3').
* * ISO 9945:2008 / IEEE 1003.1-2008 ('POSIX:2008', 'SUSv4').
*
* Note that any reference to the 1996 revision of POSIX, or any revs
* between 1990 (when '88 was approved at ISO) and 2001 (when the next
* actual revision-revision happened), are merely additions of other
* chapters (1b and 1c) outside the core interfaces.
*
* Despite having several names each, these are *reasonably* coherent
* point-in-time, list-of-definition sorts of specs. You can get each under a
* variety of names but will wind up with the same definition in each case.
*
* See standards(7) in linux-manpages for more details.
*
* Our interface to these libraries is complicated by the non-universality of
* conformance to any of them. About the only thing universally supported is
* the first (C95), beyond that definitions quickly become absent on various
...
...
@@ -124,7 +131,7 @@
pub
use
access
,
chdir
,
close
,
dup
,
dup2
,
execv
,
execve
,
execvp
,
getcwd
,
getpid
,
isatty
,
lseek
,
pipe
,
read
,
rmdir
,
unlink
,
write
;
pub
use
fstat
,
lstat
,
stat
;
pub
use
fstat
,
stat
;
mod
types
{
...
...
@@ -392,6 +399,8 @@ pub mod extra {
pub
mod
os
{
pub
mod
common
{
pub
mod
posix01
{
// Note: this is the struct called stat64 in win32. Not stat,
// nor stati64.
pub
struct
stat
{
st_dev
:
dev_t
,
st_ino
:
ino_t
,
...
...
@@ -403,7 +412,7 @@ pub struct stat {
st_size
:
int64_t
,
st_atime
:
time64_t
,
st_mtime
:
time64_t
,
st_c
_
time
:
time64_t
,
st_ctime
:
time64_t
,
}
}
}
...
...
@@ -479,6 +488,8 @@ pub mod extra {
pub
type
PBOOL
=
*
mut
BOOL
;
pub
type
WCHAR
=
wchar_t
;
pub
type
WORD
=
u16
;
pub
type
time64_t
=
i64
;
}
}
}
...
...
@@ -1025,6 +1036,12 @@ pub mod posix88 {
#[link_name
=
"_mkdir"
]
fn
mkdir
(
path
:
*
c_char
)
->
c_int
;
#[link_name
=
"_fstat64"
]
fn
fstat
(
fildes
:
c_int
,
buf
:
*
mut
stat
)
->
c_int
;
#[link_name
=
"_stat64"
]
fn
stat
(
path
:
*
c_char
,
buf
:
*
mut
stat
)
->
c_int
;
}
#[nolink]
...
...
src/libcore/path.rs
浏览文件 @
0c8a009d
...
...
@@ -190,7 +190,7 @@ pub fn default_stat() -> libc::stat {
}
}
#[cfg(target_os
=
"win
dows
"
)]
#[cfg(target_os
=
"win
32
"
)]
mod
stat
{
pub
mod
arch
{
pub
fn
default_stat
()
->
libc
::
stat
{
...
...
@@ -222,6 +222,7 @@ fn stat(&self) -> Option<libc::stat> {
}
}
#[cfg(unix)]
fn
lstat
(
&
self
)
->
Option
<
libc
::
stat
>
{
do
str
::
as_c_str
(
self
.to_str
())
|
buf
|
{
let
mut
st
=
stat
::
arch
::
default_stat
();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录