可用ls –l 查看其可行性 运行
./
4
2020/12/09
如何自动运行用户程序
rc.local
./root/usr/etc/rc.local
#///////////////// #!/bin/sh ifconfig lo 127.0.0.1 route add -net 127.0.0.0 netmask 255.0.0.0 lo portmap if [ -f /mnt/yaffs/init.sh ]; then
12
对文件操作
2020/12/09
Linux下最常用的操作就是对文件操作。 主要操作
文件的创建和读写 文件的各个属性 目录文件的操作
int open(const char *pathname,int flags);
锁定互斥量(阻塞): int pthread_mutex_lock (pthread_mutex_t *__mutex);
解锁互斥量 int pthread_mutex_unlock (pthread_mutex_t *__mutex)
销毁互斥量: int pthread_mutex_destroy (pthread_mutex_t *__mutex)
void
*(*__start_routine) (void *),void *__restrict __arg);
线程退出:
void pthread_exit (void *__retval)
等待指定的线程结束:
int pthread_join (pthread_t __th, void
**__thread_return)
/mnt/yaffs/init.sh fi #Add user’s program ./program #exec /sbin/getty ttyS0 115200