Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
X
xv6-public
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
问题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
银宸时代
OS Lab Group
奖励实验
xv6-public
提交
5d6e4065
提交
5d6e4065
4月 06, 2012
创建
作者:
Austin Clements
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Make sys_write prototype agree with user space, which takes a const void*
Most of this is propagating the const-ness through the myriad write functions.
上级
a7d4b8fe
隐藏空白字符变更
内嵌
并排
正在显示
12 个修改的文件
包含
16 行增加
和
17 行删除
+16
-17
file.hh
include/file.hh
+2
-2
kern_c.h
include/kern_c.h
+1
-1
kernel.hh
include/kernel.hh
+2
-3
net.hh
include/net.hh
+1
-1
console.cc
kernel/console.cc
+1
-1
file.cc
kernel/file.cc
+1
-1
fs.cc
kernel/fs.cc
+1
-1
net.cc
kernel/net.cc
+2
-2
pipe.cc
kernel/pipe.cc
+1
-1
sampler.cc
kernel/sampler.cc
+1
-1
spinlock.cc
kernel/spinlock.cc
+1
-1
sysfile.cc
kernel/sysfile.cc
+2
-2
没有找到文件。
include/file.hh
浏览文件 @
5d6e4065
...
...
@@ -14,7 +14,7 @@ struct file : public referenced, public rcu_freed {
int
stat
(
struct
stat
*
);
int
read
(
char
*
addr
,
int
n
);
ssize_t
pread
(
char
*
addr
,
size_t
n
,
off_t
offset
);
int
write
(
char
*
addr
,
int
n
);
int
write
(
c
onst
c
har
*
addr
,
int
n
);
enum
{
FD_NONE
,
FD_PIPE
,
FD_INODE
,
FD_SOCKET
}
type
;
...
...
@@ -75,7 +75,7 @@ struct inode : public rcu_freed {
struct
devsw
{
int
(
*
read
)(
struct
inode
*
,
char
*
,
u32
,
u32
);
int
(
*
write
)(
struct
inode
*
,
char
*
,
u32
,
u32
);
int
(
*
write
)(
struct
inode
*
,
c
onst
c
har
*
,
u32
,
u32
);
void
(
*
stat
)(
struct
inode
*
,
struct
stat
*
);
};
...
...
include/kern_c.h
浏览文件 @
5d6e4065
...
...
@@ -38,7 +38,7 @@ long sys_sbrk(int);
long
sys_nsleep
(
u64
);
long
sys_unlink
(
const
char
*
);
long
sys_wait
(
void
);
long
sys_write
(
int
,
c
har
*
,
int
);
long
sys_write
(
int
,
c
onst
void
*
,
int
);
long
sys_uptime
(
void
);
long
sys_map
(
uptr
,
u64
);
long
sys_unmap
(
uptr
,
u64
);
...
...
include/kernel.hh
浏览文件 @
5d6e4065
...
...
@@ -95,7 +95,7 @@ void iupdate(struct inode*);
void
iunlock
(
struct
inode
*
);
int
readi
(
struct
inode
*
,
char
*
,
u32
,
u32
);
void
stati
(
struct
inode
*
,
struct
stat
*
);
int
writei
(
struct
inode
*
,
char
*
,
u32
,
u32
);
int
writei
(
struct
inode
*
,
c
onst
c
har
*
,
u32
,
u32
);
struct
inode
*
idup
(
struct
inode
*
);
struct
inode
*
nameiparent
(
inode
*
cwd
,
const
char
*
,
char
*
);
int
dirlink
(
struct
inode
*
,
const
char
*
,
u32
);
...
...
@@ -160,7 +160,7 @@ void piceoi(void);
int
pipealloc
(
struct
file
**
,
struct
file
**
);
void
pipeclose
(
struct
pipe
*
,
int
);
int
piperead
(
struct
pipe
*
,
char
*
,
int
);
int
pipewrite
(
struct
pipe
*
,
char
*
,
int
);
int
pipewrite
(
struct
pipe
*
,
c
onst
c
har
*
,
int
);
// proc.c
struct
proc
*
copyproc
(
struct
proc
*
);
...
...
@@ -248,4 +248,3 @@ void trapret(void);
void
threadstub
(
void
);
void
threadhelper
(
void
(
*
fn
)(
void
*
),
void
*
arg
);
void
trap
(
struct
trapframe
*
tf
);
include/net.hh
浏览文件 @
5d6e4065
...
...
@@ -2,7 +2,7 @@
void
netclose
(
int
sock
);
int
netread
(
int
,
char
*
,
int
);
int
netwrite
(
int
,
char
*
,
int
);
int
netwrite
(
int
,
c
onst
c
har
*
,
int
);
long
netsocket
(
int
,
int
,
int
);
long
netbind
(
int
,
void
*
,
int
);
long
netlisten
(
int
,
int
);
...
...
kernel/console.cc
浏览文件 @
5d6e4065
...
...
@@ -210,7 +210,7 @@ panic(const char *fmt, ...)
}
static
int
consolewrite
(
struct
inode
*
ip
,
char
*
buf
,
u32
off
,
u32
n
)
consolewrite
(
struct
inode
*
ip
,
c
onst
c
har
*
buf
,
u32
off
,
u32
n
)
{
int
i
;
...
...
kernel/file.cc
浏览文件 @
5d6e4065
...
...
@@ -102,7 +102,7 @@ file::pread(char *addr, size_t n, off_t off)
}
int
file
::
write
(
char
*
addr
,
int
n
)
file
::
write
(
c
onst
c
har
*
addr
,
int
n
)
{
int
r
;
...
...
kernel/fs.cc
浏览文件 @
5d6e4065
...
...
@@ -569,7 +569,7 @@ readi(struct inode *ip, char *dst, u32 off, u32 n)
// PAGEBREAK!
// Write data to inode.
int
writei
(
struct
inode
*
ip
,
char
*
src
,
u32
off
,
u32
n
)
writei
(
struct
inode
*
ip
,
c
onst
c
har
*
src
,
u32
off
,
u32
n
)
{
u32
tot
,
m
;
struct
buf
*
bp
;
...
...
kernel/net.cc
浏览文件 @
5d6e4065
...
...
@@ -346,7 +346,7 @@ netclose(int sock)
}
int
netwrite
(
int
sock
,
char
*
ubuf
,
int
len
)
netwrite
(
int
sock
,
c
onst
c
har
*
ubuf
,
int
len
)
{
void
*
kbuf
;
int
cc
;
...
...
@@ -436,7 +436,7 @@ netclose(int sock)
}
int
netwrite
(
int
sock
,
char
*
buf
,
int
len
)
netwrite
(
int
sock
,
c
onst
c
har
*
buf
,
int
len
)
{
return
-
1
;
}
...
...
kernel/pipe.cc
浏览文件 @
5d6e4065
...
...
@@ -81,7 +81,7 @@ pipeclose(struct pipe *p, int writable)
//PAGEBREAK: 40
int
pipewrite
(
struct
pipe
*
p
,
char
*
addr
,
int
n
)
pipewrite
(
struct
pipe
*
p
,
c
onst
c
har
*
addr
,
int
n
)
{
int
i
;
...
...
kernel/sampler.cc
浏览文件 @
5d6e4065
...
...
@@ -220,7 +220,7 @@ sampread(struct inode *ip, char *dst, u32 off, u32 n)
}
static
int
sampwrite
(
struct
inode
*
ip
,
char
*
buf
,
u32
off
,
u32
n
)
sampwrite
(
struct
inode
*
ip
,
c
onst
c
har
*
buf
,
u32
off
,
u32
n
)
{
struct
sampconf
*
conf
;
...
...
kernel/spinlock.cc
浏览文件 @
5d6e4065
...
...
@@ -218,7 +218,7 @@ lockstat_read(struct inode *ip, char *dst, u32 off, u32 n)
}
static
int
lockstat_write
(
struct
inode
*
ip
,
char
*
buf
,
u32
off
,
u32
n
)
lockstat_write
(
struct
inode
*
ip
,
c
onst
c
har
*
buf
,
u32
off
,
u32
n
)
{
int
cmd
=
buf
[
0
]
-
'0'
;
...
...
kernel/sysfile.cc
浏览文件 @
5d6e4065
...
...
@@ -71,13 +71,13 @@ sys_pread(int fd, void *ubuf, size_t count, off_t offset)
}
long
sys_write
(
int
fd
,
c
har
*
p
,
int
n
)
sys_write
(
int
fd
,
c
onst
void
*
p
,
int
n
)
{
sref
<
file
>
f
;
if
(
!
getfile
(
fd
,
&
f
)
||
argcheckptr
(
p
,
n
)
<
0
)
return
-
1
;
return
f
->
write
(
p
,
n
);
return
f
->
write
(
static_cast
<
const
char
*>
(
p
)
,
n
);
}
long
...
...
编写
预览
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论