Skip to content

Commit f356dc5

Browse files
committed
Update spawn's comment
1 parent c0552d7 commit f356dc5

File tree

2 files changed

+3
-12
lines changed

2 files changed

+3
-12
lines changed

src/high_level.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -683,6 +683,8 @@ pub fn exec_cell(
683683

684684
/// Spawn a cell in cell dep.
685685
///
686+
/// Return the process id or a syscall error
687+
///
686688
/// # Arguments
687689
///
688690
/// * `code_hash` - the code hash to search cell in cell deps.

src/syscalls/native.rs

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -544,14 +544,13 @@ pub use crate::syscalls::internal::SpawnArgs;
544544
/// The parent process calls the Spawn system call, which creates a new process (a child process) that is an
545545
/// independent ckb-vm instance. It's important to note that the parent process will not be blocked by the child
546546
/// process as a result of this syscall.
547-
/// Note: available after ckb 2nd hardfork.
548547
///
549548
/// # Arguments
550549
///
551550
/// * `index`, `source`, `bounds` and `place` - same as exec.
552551
/// * `spgs` - spawn arguments.
553552
///
554-
/// Returns success or a syscall error.
553+
/// Returns process id or a syscall error.
555554
///
556555
/// # Scheduler Algorithm V1
557556
///
@@ -624,7 +623,6 @@ pub fn spawn(
624623
}
625624

626625
/// The syscall pauses until the execution of a process specified by pid has ended.
627-
/// Note: available after ckb 2nd hardfork.
628626
///
629627
/// # Arguments
630628
///
@@ -642,14 +640,12 @@ pub fn wait(pid: u64) -> Result<i8, SysError> {
642640
}
643641

644642
/// This syscall is used to get the current process id. Root process ID is 0.
645-
/// Note: available after ckb 2nd hardfork.
646643
pub fn process_id() -> u64 {
647644
unsafe { syscall(0, 0, 0, 0, 0, 0, SYS_PROCESS_ID) }
648645
}
649646

650647
/// This syscall create a pipe with read-write pair of file descriptions. The file descriptor with read permission is
651648
/// located at fds[0], and the corresponding file descriptor with write permission is located at fds[1].
652-
/// Note: available after ckb 2nd hardfork.
653649
pub fn pipe() -> Result<(u64, u64), SysError> {
654650
let mut fds: [u64; 2] = [0, 0];
655651
let ret = unsafe { syscall(fds.as_mut_ptr() as u64, 0, 0, 0, 0, 0, SYS_PIPE) };
@@ -662,7 +658,6 @@ pub fn pipe() -> Result<(u64, u64), SysError> {
662658

663659
/// This syscall reads data from a pipe via a file descriptor. The syscall Read attempts to read up to value pointed by
664660
/// length bytes from file descriptor fd into the buffer, and the actual length of data read is returned.
665-
/// Note: available after ckb 2nd hardfork.
666661
pub fn read(fd: u64, buffer: &mut [u8]) -> Result<usize, SysError> {
667662
let mut l: u64 = buffer.len() as u64;
668663
let ret = unsafe {
@@ -690,8 +685,6 @@ pub fn read(fd: u64, buffer: &mut [u8]) -> Result<usize, SysError> {
690685
///
691686
/// If buffer is empty and fd is avaliable, then write() can still succeed: A data with a length of 0 is written to the
692687
/// pipe. The peer needs to use a read() syscall to consume the empty data, and read() will returns Ok(0).
693-
///
694-
/// Note: available after ckb 2nd hardfork.
695688
pub fn write(fd: u64, buffer: &[u8]) -> Result<usize, SysError> {
696689
let mut l: u64 = buffer.len() as u64;
697690
let ret = unsafe {
@@ -716,7 +709,6 @@ pub fn write(fd: u64, buffer: &[u8]) -> Result<usize, SysError> {
716709

717710
/// This syscall retrieves the file descriptors available to the current process, which are passed in from the parent
718711
/// process. These results are copied from the inherited_fds parameter of the Spawn syscall.
719-
/// Note: available after ckb 2nd hardfork.
720712
pub fn inherited_fds(fds: &mut [u64]) -> u64 {
721713
let mut l: u64 = fds.len() as u64;
722714
unsafe {
@@ -735,7 +727,6 @@ pub fn inherited_fds(fds: &mut [u64]) -> u64 {
735727

736728
/// This syscall manually closes a file descriptor. After calling this, any attempt to read/write the file descriptor
737729
/// pointed to the other end would fail.
738-
/// Note: available after ckb 2nd hardfork.
739730
pub fn close(fd: u64) -> Result<(), SysError> {
740731
let ret = unsafe { syscall(fd, 0, 0, 0, 0, 0, SYS_CLOSE) };
741732
match ret {
@@ -754,8 +745,6 @@ pub fn close(fd: u64) -> Result<(), SysError> {
754745
/// * `offset` - offset
755746
/// * `index` - index of cell
756747
/// * `source` - source of cell
757-
///
758-
/// Note: available after ckb 2nd hardfork.
759748
pub fn load_block_extension(
760749
buf: &mut [u8],
761750
offset: usize,

0 commit comments

Comments
 (0)