Linux kernel programming: Linux2.6 Kernel Source Parsing _ process traversal

Source: Internet
Author: User

/*    *file    : test.c  *author  :  davidlin       *date    : 2014-12-07pm        *Email   : [email protected] or [email  protected]       *world   : the city of  sz, in china       *ver     :  000.000.001       *history :     editor       time            do &NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;*&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;1) linpeng       2014-12-07      created  This file!  &nBSP;&NBSP;&NBSP;&NBSP;&NBSP;*&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;2)         */   #include  <linux/init.h> #include  <linux/list.h># include <linux/module.h> #include  <linux/sched.h>static int list_init (void) {     struct task_struct *task;         Task = null;         for_each_process (Task)  { &NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;PRINTK ("pid = %d\n",  task->pid);     }    return 0;} Static void list_exit (void) {&NBSP;&NBSP;&NBSP;&NBSP;PRINTK ("kernel macro: for_each_process  exit\n ");} Module_init (List_init); Module_exit (List_exit); Module_author ("Linpeng1577"); Module_description ("Kernel 2.6 macro study"); Module_licenes (GPL);



Linux kernel programming: Linux2.6 Kernel Source Parsing _ process traversal

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.