EmbLogic's Blog

Category Archives: Uncategorized

how to rotate bits of unsigned integer to left/right by specific number of bits???

Posted in Uncategorized | 3 Comments

signal problems:

#include<stdio.h> #include<unistd.h> #include<sys/types.h> #include<signal.h> void outch(int sig) { printf(“outch:i got a signal no.=%d\n”,sig); sleep(5); printf(“handler for signal no.=%d has ended\n”,sig); } int main() { struct sigaction act,act1; act.sa_handler=outch; sigemptyset(&act.sa_mask); sigaddset(&act.sa_mask,SIGQUIT); sigaction(SIGINT,&act,0); sigaction(SIGQUIT,&act,0); act1.sa_handler=outch; sigemptyset(&act1.sa_mask); sigaddset(&act1.sa_mask,SIGTSTP); sigprocmask(SIG_BLOCK,&act1.sa_mask,&act.sa_mask); while(1) { printf(“hello\n”); sleep(1); … Continue reading →

Posted in Uncategorized | 5 Comments

Errors occured in toolchain

[Japjeet@localhost build-boot-gcc]$ ../gcc-2.95.3/configure –target=$TARGET –prefix=${PREFIX} –disable-shared –with-headers=${TARGET_PREFIX}/include –with-newlib –enable-languages=c Following Error occur: Config.guess failed to determine the host type. You need to specify one. Usage: configure [OPTIONS] [HOST] Options: [defaults in brackets] –prefix=MYDIR install into MYDIR [/usr/local] –exec-prefix=MYDIR install host-dependent … Continue reading →

Posted in Uncategorized | Leave a comment

Order of Precedence

Operators of the same priority are evaluated from left to right, so that Operators of the same priority are evaluated from left to right, so that a – b – c is evaluated as ( a – b ) – … Continue reading →

Posted in Uncategorized | 3 Comments

FILE I/O

// // Reading a txt File using Pointers // #include<stdio.h> #include<stdlib.h>   // Header File For malloc FILE *fptr; char *ch; int ret,ret2; int main() { printf(“\n”); fptr = fopen(“f1.txt”,”r”); if (fptr == NULL) { printf(“Error Opening File”); } else    … Continue reading →

Posted in Uncategorized | 4 Comments

Plz any one give ans

Which is/are the type/s of memory allocation that needs/need the programmer to take care of memory management? 1. Static memory allocation //true  or false 2. Dynamic memory allocation //true  or false 3. Automatic memory allocation //true  or false 4. Memory … Continue reading →

Posted in Uncategorized | 1 Comment

I want code optimization

Dear All!! I have done this assignment but Ain’t satisfying. I want code optimization. Assignment No. =>005_16(Q.No.17)  Write a program to find the number of times that a given word(i.g a short string) occurs in a sentence (i.e. a long … Continue reading →

Posted in Uncategorized | Leave a comment

assignment no.1 Qno. 12

Dear all In question no. 12 of assignment Ist int ten =10; int two=2; printf(“%d minus%d=%d\n”,ten); printf(“%dminus %d=%d\n”,ten,2,ten-two); printf(“%dminus%d is %d\n”,ten); return 0; i was surprised to c the result of 3rd printf statement. Ist and IInd printf statemnt result … Continue reading →

Posted in Uncategorized | 2 Comments

Negative characters in c

??how char can be signed / unsigned ??? how can we define a negative char …. and why we need negative char ?

Posted in Uncategorized | 2 Comments

makefile 105: linux kernel source not configured missing autoconf.h fadora

hi, I have installed the fedora than updated the kernel. In my desktop the LAN port was not identified by the OS, so I have downloaded it but when I try to call make command. I got this error. makefile … Continue reading →

Posted in Uncategorized | Tagged | Leave a comment

not executing the Signal handler function

Hi All, in the following program I have observed that the program is not jumped on the handler but if i remove the statement sleep(1); it work fine. the piece of the code is … while(1) { if (flag) printf(“waiting … Continue reading →

Posted in Uncategorized | Tagged | 3 Comments

EXECL: Exec format error

int ret = execl(“./pipe2.c”,”pipe2.c”,”A”,(char *)0); if(ret < 0) {perror(“EXECL”); exit(EXIT_FAILURE); } } on execution i am getting EXEC: Exec format error ?? why

Posted in Uncategorized | 1 Comment

how can i insert a space using module_param through commandline??

Here is my source code —- #include #include #include #include #include #include #ifndef DEBUG #define DEBUG #endif MODULE_LICENSE(“GPL”); MODULE_AUTHOR(“VAIBHAV”); MODULE_DESCRIPTION(“Simple Modules init and exit”); static short int data=4; static int i=2; static long int j=1; static char *si=” vaibhav “; … Continue reading →

Posted in Uncategorized | Leave a comment

File Transfer Protocol (FTP)

FTP requires two computers, one running an FTP server, the other running an FTP client. The exchange is initiated by the client which logs in under an accepted user name and password. Once this occurs, a session is opened and … Continue reading →

Posted in Uncategorized | Leave a comment

FTP Protocol

The design objectives of FTP were as follows: 1. To promote sharing of files (computer programs or data). 2 To encourage indirect or implicit use of remote computers (i.e. to be a network based application that can be readily employed). … Continue reading →

Posted in Uncategorized | Leave a comment