You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: linux_kernel.rb
    path of file: ./repos/metasploit-framework/lib/msf/core/exploit/local
    
    the code of the file until where you have to start completion: # -*- coding: binary -*-

module Msf
module Exploit::Local::LinuxKernel
  include Msf::Exploit::Local::CompileC

  def current_task_struct_h(metasm_exe)
    metasm_exe.parse <<-EOS
      current_stack_pointer:
        mov eax, esp
        ret
    EOS

  
    
  def current_task_struct_h(metasm_exe)
    metasm_exe.parse <<-EOS
      current_stack_pointer:
        mov eax, esp
        ret
    EOS

    # Taken from sock_sendpage.c
    cparser.parse <<-EOC
#define TASK_RUNNING 0

int current_stack_pointer(void);

static inline unsigned long
current_task_struct(void)
{
  unsigned long task_struct, thread_info;

  thread_info = current_stack_pointer() & ~(4096 - 1);

  if (*(unsigned long *)thread_info >= 0xc0000000) {
    task_struct = *(unsigned long *)thread_info;

    /*
     * The TASK_RUNNING is the only possible state for a process executing
     * in user-space.
     */
    if (*(unsigned long *)task_struct == TASK_RUNNING)
      return task_struct;
  }

  /*
   * Prior to the 2.6 kernel series, the task_struct was stored at the end
   * of the kernel stack.
   */
  task_struct = current_stack_pointer() & ~(8192 - 1);

  if (*(unsigned long *)task_struct == TASK_RUNNING)
    return task_struct;

  thread_info = task_struct;

  task_struct = *(unsigned long *)thread_info;

  if (*(unsigned long *)task_struct == TASK_RUNNING)
    return task_struct;

  return -1;
}

EOC

  end