Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the functions and header files commonly used in Linux kernel development

2025-03-26 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

Linux kernel development commonly used functions and their header files, many novices are not very clear about this, in order to help you solve this problem, the following editor will explain in detail for you, people with this need can come to learn, I hope you can gain something.

1. Protocol

/ / protocol//-include/linux/in.hIPPROTO_UDPINADDR_ANYstruct sockaddr_in//-include/linux/ip.h struct iphdrip_hdr () / /-include/linux/udp.h struct udphdrudp_hdr () / /-include/linux/tcp.h struct tcphdrtcp_hdr ()

II. Sk_buff

/ / sk_buff//-include/linux/skbuff.hstruct sk_buff

III. Memory

/ / memory//-include/linux/slab_def.hkmalloc () / /-include/linux/slab.hkfree () ksize () / /-include/linux/gfp.hGFP_KERNEL

IV. String

/ / string//-include/linux/string.hstrcmp () strim () strrchr () strsep () strpbrk () memset () memcpy () memmove ()

5. Byteorder

/ / byteorder//-include/linux/byteorder/generic.hntohs () _ _ be16_to_cpu ()

VI. Output

/ / output//-include/linux/kernel.hprintk () /-lib/vsprintf.c sprintf () snprintf ()

7. Process

/ / process//-include/linux/sched.hstruct task_structTASK_RUNNINGset_task_state () set_current_state () / /-include/asm-generic/current.hcurrent//-include/linux/thread_info.h set_need_resched () clear_need_resched () / /-arch/x86/include/asm/thread_info.h struct thread_info

VIII. Thread

/ / thread//-include/linux/kthread.hkthread_create () kthread_stop () / /-include/linux/sched.hwake_up_process

IX. Wait queue

/ / waitqueue / /-include/linux/wait.hwait_queue_head_tinit_waitqueue_head () wake_up () wait_event ()

10. Lock

/ / lock//-include/asm-generic/atomic.hatomic_inc () / /-include/linux/spinlock.h spin_lock () spin_lock_bh () / /-include/linux/rcupdate.h rcu_read_lock () synchronize_rcu ()

11. Time

/ / time//-include/linux/raid/pq.hHZ/jiffies//-include/linux/time.h struct timespecget_seconds () current_kernel_time () mktime () / /-include/linux/timer.hstruct timer_listinit_timer () mod_timer () add_timer () del_timer () / /-include/linux/jiffies.htime _ before () time_after_eq () jiffies_to_msecs ()

12. Cpu

/ / cpu//-include/linux/cpumask.hnum_online_cpus () for_each_possible_cpu () / /-include/linux/smp.hsmp_processor_id () get_cpu () / /-include/linux/percpu.hget_cpu_var () / /-include/asm-generic/percpu.h per_cpu () _ get_cpu_var () / / DEFINE_PER_CPU

XIII. Proc file

/ / proc file//-include/linux/sysctl.hstruct ctl_tablestruct ctl_table_headerregister_sysctl_table () register_sysctl_table () proc_dointvec () proc_doulongvec_minmax () proc_dostring ()

14. Uio

/ / uio//-include/linux/platform_device.hstruct platform_deviceplatform_device_register_simple () platform_device_unregister () / /-include/linux/device.hstruct device_driverdriver_register () driver_unregister () / /-include/linux/uio_driver.hstruct uio_infoUIO_IRQ_NONEuio_register_device () uio_unregister_device ()

15. Random

/ / random//-include/linux/random.hrandom32 ()

16. Device

/ / is it helpful for device//-include/linux/netdevice.hstruct net_device//-include/linux/pci.hstruct pci_driver//-include/linux/mod_devicetable.hstruct pci_device_id to read the above content? If you want to know more about the relevant knowledge or read more related articles, please follow the industry information channel, thank you for your support.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report