Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

copy(9) [v7 man page]

COPY(9) 						   BSD Kernel Developer's Manual						   COPY(9)

NAME
copy, copyin, copyout, copystr, copyinstr -- kernel copy functions SYNOPSIS
#include <sys/types.h> #include <sys/systm.h> int copyin(const void *uaddr, void *kaddr, size_t len); int copyout(const void *kaddr, void *uaddr, size_t len); int copystr(const void *kfaddr, void *kdaddr, size_t len, size_t *done); int copyinstr(const void *uaddr, void *kaddr, size_t len, size_t *done); DESCRIPTION
The copy functions are designed to copy contiguous data from one address to another. All but copystr() copy data from user-space to kernel- space or vice-versa. The copy routines provide the following functionality: copyin() Copies len bytes of data from the user-space address uaddr to the kernel-space address kaddr. copyout() Copies len bytes of data from the kernel-space address kaddr to the user-space address uaddr. copystr() Copies a NUL-terminated string, at most len bytes long, from kernel-space address kfaddr to kernel-space address kdaddr. The number of bytes actually copied, including the terminating NUL, is returned in *done (if done is non-NULL). copyinstr() Copies a NUL-terminated string, at most len bytes long, from user-space address uaddr to kernel-space address kaddr. The num- ber of bytes actually copied, including the terminating NUL, is returned in *done (if done is non-NULL). RETURN VALUES
The copy functions return 0 on success or EFAULT if a bad address is encountered. In addition, the copystr(), and copyinstr() functions return ENAMETOOLONG if the string is longer than len bytes. SEE ALSO
fetch(9), store(9) BSD
January 7, 1996 BSD

Check Out this Related Man Page

COPY(9) 						   BSD Kernel Developer's Manual						   COPY(9)

NAME
copy, copyin, copyout, copystr, copyinstr -- kernel copy functions SYNOPSIS
#include <sys/types.h> #include <sys/systm.h> int copyin(const void *uaddr, void *kaddr, size_t len); int copyout(const void *kaddr, void *uaddr, size_t len); int copystr(const void *kfaddr, void *kdaddr, size_t len, size_t *done); int copyinstr(const void *uaddr, void *kaddr, size_t len, size_t *done); DESCRIPTION
The copy functions are designed to copy contiguous data from one address to another. All but copystr() copy data from user-space to kernel- space or vice-versa. The copy routines provide the following functionality: copyin() Copies len bytes of data from the user-space address uaddr to the kernel-space address kaddr. copyout() Copies len bytes of data from the kernel-space address kaddr to the user-space address uaddr. copystr() Copies a NUL-terminated string, at most len bytes long, from kernel-space address kfaddr to kernel-space address kdaddr. The number of bytes actually copied, including the terminating NUL, is returned in *done (if done is non-NULL). copyinstr() Copies a NUL-terminated string, at most len bytes long, from user-space address uaddr to kernel-space address kaddr. The num- ber of bytes actually copied, including the terminating NUL, is returned in *done (if done is non-NULL). RETURN VALUES
The copy functions return 0 on success or EFAULT if a bad address is encountered. In addition, the copystr(), and copyinstr() functions return ENAMETOOLONG if the string is longer than len bytes. SEE ALSO
fetch(9), store(9) BSD
January 7, 1996 BSD
Man Page

14 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Unmatched 'then'

I am having a problem with the following statement in a korn shell script: if "$all_recs" = "ALL"; then commands fi; I keep getting the error syntax error at line 999 : 'then' unmatched. I'm sure it is a minor problem, but have been unable to find any answers online. Any help... (22 Replies)
Discussion started by: akpopa
22 Replies

2. UNIX for Dummies Questions & Answers

Copying files with the latest date

Hi All, I have a situation where I need to copy the files having the latest date. For example I have a file by name bas100e1_jun05. I need to copy it to bas100e1. But when a file by name bas100e1_jul05 is put in the same directory the script should copy the file having the latest month which... (34 Replies)
Discussion started by: shashi_kiran_v
34 Replies

3. UNIX for Dummies Questions & Answers

Copy all the files with time stamp and remove header,trailer from file

All, I am new to unix and i have the following requirement. I have file(s) landing into input directory with timestamp, first i want to copy all these files into seperate directory then i want to rename these files without timestamp and also remove header,trailer from that file.. Could... (35 Replies)
Discussion started by: ksrams
35 Replies

4. Shell Programming and Scripting

Perl or Awk script to copy a part of text file.

Hi Gurus, I'm a total newbie to Perl and Awk scripting. Let me explain the scenario, there is a DB2 table with 5 columns and one of the column is a CLOB datatype containing XML. We need all the 4 columns but only a portion of string from the XML column. We decided to export DB2 table to a .del... (26 Replies)
Discussion started by: asandy1234
26 Replies

5. UNIX for Dummies Questions & Answers

How can i copy a list of files with different names into others directory have the same name?

dear all. how can i copy a list of files with different names into others directory have the same name like i have 3 files 10_10 10_10_11 10_10_11_12 and i have 3 directories 10_10 10_10_11 10_10_11_12 how can i make a loop to cp this files into the directory have the same name like... (31 Replies)
Discussion started by: t17
31 Replies

6. Emergency UNIX and Linux Support

Copy a file from Linux

Hi Experts, I want to copy a file from a Linux machine to another Linux machine or a windows machine shared drive. I mean to say.. cp filename //hostname/shareddrive I don't want to mount. Is there any way we can do it. Regards Naree (34 Replies)
Discussion started by: naree
34 Replies

7. AIX

Copy huge files system

Dear Guy’s By using dd command or any strong command, I’d like to copy huge data from file system to another file system Sours File system: /sfsapp File system has 250 GB of data Target File system: /tgtapp I’d like to copy all these files and directories from /sfsapp to /tgtapp as... (28 Replies)
Discussion started by: Mr.AIX
28 Replies

8. Shell Programming and Scripting

Copy file to SD card from internal flash.

Hi, At first I have to say that I know nothing about Linux :( But I am looking for solution how to copy one file from internal Lowrnace HDS flash memory. Lowrance HDS is Linux based device. Here is the link for firmware update files for this unit. At the end of main firmware file there... (62 Replies)
Discussion started by: PouchX
62 Replies

9. Shell Programming and Scripting

cp | greb

Hi guys, First of all thanks for reading this and the already provided information! I was reading about a post that was created a couple of years back: 86686-ls-l-all-files-created-between-two-times.html (i am not allowed to copy urls :( ) My question is somehow similar. I have a... (26 Replies)
Discussion started by: alpha_mouse
26 Replies

10. Shell Programming and Scripting

Making a script to copy files not seen before (using md5sum)

Hello, I would like to make a script that searches through a SRC folder and copies only files it's never seen before to a DEST folder. SRC = /user/.phonesync/photos-backup DST = /usr/.phonesync/photos-new So basically, I'd start with a: md5sum /user/.phonesync/photos-backup/* >... (29 Replies)
Discussion started by: nbsparks
29 Replies

11. Shell Programming and Scripting

Problem scripting a copy and renaming shell executable

I also posted this on macrumors forum, then i realized that this is a more suitable forum for matters like this. I apologize for the username, I was looking at a bag of doritos when it asked me for a username. lol I need a program (see below for what I've tried) and I think a shell program will... (23 Replies)
Discussion started by: ilovedoritos
23 Replies

12. Shell Programming and Scripting

Read multiple text files and copy data to csv

hi i need to extract lines from multiple files to a csv file. for example, i have these 3 files file1.txt date:29dec1980 caller:91245824255 called:8127766 file2.txt date:11apr2014 caller:9155584558 called:8115478 file3.txt date:25jun2015 caller:445225552 called:8117485 (30 Replies)
Discussion started by: lp.descamps
30 Replies

13. Shell Programming and Scripting

Copy content of file in different file

Dear all, I get a file which is probably in hexadecimal character which i have to load in oracle. oracle is unable to process the original file but when i copy the content into notepad it works fine. How can i achieve in unix to copy content of file into .txt file instead of cp command as cp... (23 Replies)
Discussion started by: guddu_12
23 Replies

14. UNIX for Beginners Questions & Answers

How to copy a column of multiple files and paste into new excel file (next to column)?

I have data of an excel files as given below, file1 org1_1 1 1 2.5 100 org1_2 1 2 5.5 98 org1_3 1 3 7.2 88 file2 org2_1 1 1 2.5 100 org2_2 1 2 5.5 56 org2_3 1 3 7.2 70 I have multiple excel files as above shown. I have to copy column 1, column 4 and paste into a new excel file as... (26 Replies)
Discussion started by: dineshkumarsrk
26 Replies