./configure --shared --prefix=/usr/local/arm/arm-uclibc-3.3.5
CROSS=arm-linux- CC=$(CROSS)gcc LDSHARD=$(CROSS)gcc -shared -Wl,-soname,libz.so.1 CPP=$(CROSS)gcc -E AR=$(CROSS)ar rc RANLIB=$(CROSS)ranlib
ar rcs 정적라이브러리명.a 파일1.o 파일2.o 파일3.o ...
ar rcs libmy.a 파일1.o 파일2.o
gcc -shared -Wl,-soname,your_soname \ -o libarary_name file_list library_list
gcc -fPIC -g -c -Wall 파일1.c gcc -fPIC -g -c -Wall 파일2.c gcc -shared -Wl,-soname,libmy.so.1 \ -o libmy.so.1.0.1 파일1.o 파일2.o -lc
ifneq ($(KERNELRELEASE),) #call from kernel build system foobar-objs := foo_1.o foo_2.o obj-m := foobar.o else KERNELDIR ?= /YOUR/KERNEL/SOURCE/PATH PWD := $(shell pwd) modules: $(MAKE) -C $(KERNELDIR) M=$(PWD) modules endif clean: rm -rf *.o *~ core .depend .*.cmd .*.o.d *.ko *.mod.c .tmp_versions
struct task_struct *p; read_lock(&tasklist_lock); p = find_task_by_pid(pid); read_unlock(&tasklist_lock);
typedef struct siginfo { int si_signo; int si_errno; int si_code; union { ... } _sifields; } siginfo_t; #define si_pid _sifields._kill._pid ... #define si_int _sifields._rt._sigval.sival_int ...
recalc_sigpendign | |
dequeue_signal | |
flush_signals | |
force_sig | |
kill_pg | |
kill_proc | 호출한 프로세스(pid)에 signal을 보낸다 |
ptrace_notify | |
send_sig | |
send_sig_info | siginfo의 내용을 보내려면 이 함수를 이용한다 |
sigprocmask | |
block_all_signals | |
unblock_all_signals |
kill_proc(cpid, SIGINT, 1);
struct siginfo info; info.si_signo = SIGUSR2; info.si_errno = 0; info.si_code = SI_QUEUE; info.si_int = flags; if (send_sig_info(SIGUSR2, &info, p)) send_sig_info(SIGINT, (struct siginfo *)1, p);
char *name = "MyIO"; if (!request_mem_region(phys, size, name)) return -EBUSY; virt = ioremap(phys, size);
release_mem_region(phys, size); iounmap((void *)virt);
#CROSS := arm-linux- CC := $(CROSS)gcc LIBS := -lpthread INCDIR := -I./ CFLAGS = -Wall -O2 $(INCDIR) BIN := dj_run2 OBJS := dj_event2.o dj_run2.o SRCS := $(OBJS:.o=.c) all: $(BIN) $(BIN): $(OBJS) $(CC) $(CFLAGS) $(LIBS) -o $@ $^ %.o:%.c $(CC) $(CFLAGS) -c -o $@ $< clean: rm -f *.o $(BIN) tags: find ./ -name "*.[ch]" | ctags -L- dep: gccmakedep -- $(CFLAGS) -- $(SRCS)
#include <signal.h> void (*signal(int sig, void (*func)(int)))(int);