summaryrefslogtreecommitdiff
path: root/packages/pad
diff options
context:
space:
mode:
authorKoen Kooi <koen@openembedded.org>2005-06-30 08:19:37 +0000
committerOpenEmbedded Project <openembedded-devel@lists.openembedded.org>2005-06-30 08:19:37 +0000
commitc8e5702127e507e82e6f68a4b8c546803accea9d (patch)
tree00583491f40ecc640f2b28452af995e3a63a09d7 /packages/pad
parent87ec8ca4d2e2eb4d1c1e1e1a6b46a395d56805b9 (diff)
import clean BK tree at cset 1.3670
Diffstat (limited to 'packages/pad')
-rw-r--r--packages/pad/.mtn2git_empty0
-rw-r--r--packages/pad/pad/.mtn2git_empty0
-rwxr-xr-x[-rw-r--r--]packages/pad/pad/pad.c40
3 files changed, 40 insertions, 0 deletions
diff --git a/packages/pad/.mtn2git_empty b/packages/pad/.mtn2git_empty
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/packages/pad/.mtn2git_empty
diff --git a/packages/pad/pad/.mtn2git_empty b/packages/pad/pad/.mtn2git_empty
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/packages/pad/pad/.mtn2git_empty
diff --git a/packages/pad/pad/pad.c b/packages/pad/pad/pad.c
index e69de29bb2..e81e22504d 100644..100755
--- a/packages/pad/pad/pad.c
+++ b/packages/pad/pad/pad.c
@@ -0,0 +1,40 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
+
+int stat(const char *file_name, struct stat *buf);
+
+int syntax(void)
+{
+ printf("syntax:\n");
+ printf(" pad padnum filename\n");
+ return(0);
+}
+
+int main(int argc, char **argv)
+{
+ FILE *fp;
+ long int i=0L, padsize=0L;
+ unsigned char data=0xff;
+ struct stat fileinfo;
+ if(argc<3){
+ syntax();
+ exit(1);
+ }
+ if((fp=fopen(argv[2],"a"))==NULL){
+ printf("error opening %s.\n",argv[2]);
+ exit(1);
+ }
+ if(stat(argv[2],&fileinfo)!=0){
+ printf("error in stat of %s.\n",argv[2]);
+ exit(1);
+ }
+ padsize = strtol(argv[1],NULL,10) - fileinfo.st_size;
+ for(i=0;i<padsize;i++){
+ fwrite(&data,1,1,fp);
+ }
+ fclose(fp);
+ return(0);
+}