How can you see which code a module executes when your app calls an ioctl system call?
Consider this situation:
You app gets to the point where it executes an ioctl syscall and returns an error, e.g.
if (ioctl(fd, STVMIX_IOC_DISCONNECTLAYERS, &STVMIX_Ioctl_DisconnectLayers) != 0) { /* IOCTL failed */ ErrorCode = ST_ERROR_BAD_PARAMETER; printf (” STVMIX_DisconnectLayers():Ioctl error […]
To convert a UNIX datetime value to date/time string in OpenOffice Calc or Excel use this formula (assumes your datetime stamp is in the A1 cell of the current spreadsheet):
=A1/86400+DATEVALUE(“1/1/1970”)
If you want to test the above you may use the following simple C program:
=======
#include <stdio.h> #include <stdlib.h> […]
How can we map the enum values to strings in the C programing language?
Often times you need to display a C enum as a string, most often when debugging or handling error conditions.
Typical techiques involve usually: a) defining an array of strings (the strings being the enum names of course, and the string […]
Often times it is useful to construct a string visible to the pre-compiler and assemble it from one more more other values, defined by means of a #define dierctive. Here’s some example code (this is some custom environemnt config for U-Boot for a STM-based device I work with):
#if defined( DEVELOPER_ALAN ) #define CONFIG_ETHADDR 00:23:b0:00:00:00 […]
1. Make sure your debuginfo files are part of LD_LIBRARY_PATH.
To do this, either
a) add the path where you stored the .debug files to your LD_LIBRARY_PATH environment variable, e.g.:
$ export LD_LIBRARY_PATH=/opt/STM/STLinux-2.3/devkit/sh4_uclibc/target/usr/lib/debug:/opt/STM/STLinux-2.3/devkit/sh4_uclibc/bin/../lib:/opt/STM/STMCR1.5.0/lib:/opt/STM/STLinux-2.3/devkit/sh4_uclibc/bin/../../../host/stmc/lib
Then restart gdb.
OR
b) start gdb and set the LD_LIBRARY_PATH from within gdb:
(gdb) set env LD_LIBRARY_PATH […]
Often times, when working with the standard Linux/UNIX time format (time_t) one needs to quickly find out what is the “human readable” date and time text string a particular time_t value corresponds to.
NOTE: The ‘C’ time_t type is the number of seconds elapsed since the “epoch”, the epoch being January 1st 1970 at 00:00:00.
[…]
To check your libc (glibc) version type “ls -l /lib/libc.” and hit TAB. This should expand the line into the name of your libc library file, e.g. something like /lib/libc.so.6
Umm… no, the .6 does not mean that your glibc version is 6, unfortunately it is a little more complicated than that 🙂 … but not […]
This post will be dedicated to gcc’s command line options and various other questions related to compiling/building your code with gcc. For example…
——————–
How can I get gcc to generate assembly code for my C file:
gcc -O2 -S -c foo.c
——————–
How can I tell gcc to generate […]
-
Categories
- Android Development
- Bash
- C programming
- dpkg/apt-get
- drupal
- Emacs
- Git
- Java
- Linux administration
- Linux device drivers
- Linux Gaming
- Linux kernel
- Linux Networking
- Linux on Windows
- Linux printing
- Linux sound and ALSA
- Package Managers
- Programming
- RPM
- Shell and environment
- Tips and tricks
- Uncategorized
- VirtualBox
- Virtualization
- web development
- wine
- WMaker
- Wordpress Tips
- X Window System
- XFCE
-
Articles
- August 2020
- August 2019
- May 2019
- July 2017
- February 2017
- January 2017
- November 2016
- October 2016
- September 2016
- August 2016
- July 2016
- June 2016
- April 2016
- March 2016
- December 2015
- November 2015
- September 2015
- June 2015
- May 2015
- April 2015
- March 2015
- February 2015
- January 2015
- December 2014
- October 2014
- February 2014
- January 2014
- November 2013
- October 2013
- June 2013
- April 2013
- March 2013
- February 2013
- January 2013
- December 2012
- October 2012
- August 2012
- July 2012
- June 2012
- May 2012
- April 2012
- March 2012
- February 2012
- September 2011
- August 2011
- June 2011
- May 2011
- April 2011
- March 2011
- February 2011
-
Calendar
June 2023 M T W T F S S « Aug 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 -
Meta
Cloud
audio bash boot compile C programming cups drupal emacs etc Fedora git grep how to httpd init kernel libc linux linux partition localtime login make mount mp3 mysql networking oracle package managers password phpMyAdmin programming rpm shell sql vbox version control system virtual box vm web server wordpress www xargs xfce xwin yum