• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

C Library

Basics of C programming

by admin

Structure of C Program A C program is divided into different sections. There are six main sections to a basic c program. The six sections are: Documentation Link Definition Global Declarations Main functions Sub programs The whole code follows this outline. Each code has a similar outline. Now let us learn about each of these […]

Filed Under: C, C Library

Serial Port Programming: tcflush – TCIFLUSH,TCOFLUSH example

by admin

termios The termios module provides a POSIX-style interface for controlling the behavior of TTYs and other serial communication devices on UNIX systems. All the functions operate on integer file descriptors such as those returned by the os.open() function or the fileno() method of a file object. In addition, the module relies on a large collection […]

Filed Under: C, C Library

Linux Device Driver example for dump_stack() to print the stack trace of module loading

by admin

One of the useful options in debugging is to print the call trace/stack trace. Linux kernel provides a function to print the stack trace: dump_stack(). The dump_stack function produces a stack trace much like panic and oops, but causes no problems and we return to the normal control flow. Calling dump_stack() function will print the […]

Filed Under: C, C Library

oe-pkgdata-util utility in Yocto

by admin

oe-pkgdata-util is helpful in determining why a file is included in the root file system. For example, on the development machine: $ oe-pkgdata-util find-path /etc/inittab sysvinit-inittab: /etc/inittab $ oe-pkgdata-util find-path */libncurses.so* ncurses-libncurses: /lib64/libncurses.so.5 ncurses-libncurses: /lib64/libncurses.so.5.9 ncurses-dbg: /lib64/.debug/libncurses.so.5.9 lib32-ncurses-dbg: /lib/.debug/libncurses.so.5.9 ncurses-dev: /usr/lib64/libncurses.so lib32-ncurses-dev: /usr/lib/libncurses.so lib32-ncurses-libncurses: /lib/libncurses.so.5.9 lib32-ncurses-libncurses: /lib/libncurses.so.5 The other way is given a recipe and […]

Filed Under: C, C Library

Yocto recipetool tutorial

by admin

The recipetool allows for the easier creation of a base recipe based on the source code files. As long as you can extract or point to the source files, the recipetool will generate a recipe and automatically configure all pre-built information into the new recipe file. There are two ways of writing a recipe: Writing […]

Filed Under: C, C Library

pthread_yield example in c

by admin

One advantage to using threads is that they can execute for a very long time without preventing the execution of your main thread/application. The downside is that threads that execute without an end can end up consuming too much CPU. In some cases, however, the user might need the thread to perform an action and […]

Filed Under: C, C Library

Serial Port Programming – Reading/Writing Status of Control Lines: DTR/RTS/CTS/DSR

by admin

tiocmget and tiocmset In the 2.4 and older kernels, there used to be a number of tty ioctl calls to get and set the different control line settings. These were denoted by the constants TIOCMGET, TIOCMBIS, TIOCMBIC, and TIOCMSET. TIOCMGET was used to get the line setting values of the kernel, and as of the […]

Filed Under: C, C Library

StringCchCat Function example

by admin

StringCchCat is used to concatenate one string to another string. It is also important to remember that the Strsafe functions, such as StringCchCopy() and StringCchCat(), do not have the same semantics as the strncpy_s() and strncat_s() functions. When strncat_s() detects an error, it sets the destination string to a null string while StringCchCat() fills the […]

Filed Under: C, C Library

Primary Sidebar

Recent Posts

  • ncat Command Examples in Linux
  • ncat: command not found
  • nautilus Command Examples in Linux
  • namei: command not found

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright