Sponsored Content
Full Discussion: read function
Top Forums UNIX for Dummies Questions & Answers read function Post 19562 by rwb1959 on Friday 12th of April 2002 04:55:47 PM
Old 04-12-2002
It would be better if we could see your code (excerpts) that
setup and do the message exchange. There are some operations
in which you must interleave reads and writes but if you wrote
some sort of socket (UNIX or INET) communications, this should
not be an issue. If you can't post code excerpts, try to give
as much detail about what you are doing and how you are doing
it. Maybe someone can help.
 

10 More Discussions You Might Find Interesting

1. Programming

read a file wich fscanf() in a function

I use fopen, fscanf, fclose to read a file. It can work well. since many files should be read, a function is created with the same code. But in the function, fscanf can not work well. for example, the first line of the the file is: > filename but the fscanf will give: 207/23/eee/34 it appears... (2 Replies)
Discussion started by: cdbug
2 Replies

2. Programming

Cannot read a file with read(fd, buffer, buffersize) function

# include <stdio.h> # include <fcntl.h> # include <stdlib.h> # include <sys/stat.h> int main(int argc, char *argv) { int fRead, fPadded, padVal; int btRead; int BUFFSIZE = 512; char buff; if (argc != 4) { printf ("Please provide all of the... (3 Replies)
Discussion started by: naranja18she
3 Replies

3. Shell Programming and Scripting

read statement not working in a function

Pls this is emergency.I have written a script which is taking input from another script. and the contents of my second script are acting as functions to my main script.Now the problem is that in one of the functions i want the script ececution to stop and start when user enters any character r... (2 Replies)
Discussion started by: sumitdua
2 Replies

4. UNIX for Dummies Questions & Answers

Can we read in variable into function in Unix?

can u read variables into function in unix like java or c++ eg sum($1) { if echo "$1 is equal to yes" else echo "$1 not equal to yes" } and if so what r the rulz to using function in unix for using functions thanks in advance :confused: (1 Reply)
Discussion started by: ShinTec
1 Replies

5. UNIX for Dummies Questions & Answers

Can you read in variable into function in Unix?

can you read variables into function in unix like java or c++ eg sum($1) { if echo "$1 is equal to yes" else echo "$1 not equal to yes" } and if so what are the rules to reading variables into function in unix thanks in advance for your answer (2 Replies)
Discussion started by: ShinTec
2 Replies

6. Shell Programming and Scripting

Help with grep and read function in a BASH Script

I'm putting together a script that will search my mail archives for emails that meet certain criteria and output the files to a text file. I can manually cat that text file and pipe it into sendmail and it will work (i.e. cat /pathtofile/foo.txt | sendmail -t me@company.com) My script sends... (7 Replies)
Discussion started by: binary-ninja
7 Replies

7. Shell Programming and Scripting

bash read within function with arguments

I have trouble getting this logic to work #!/bin/bash function assign_var(){ while do read -p "$2 :" $3 done } assign_var '$IPADDRESS' ipaddress IPADDRESS Basicly, i want to make sure that entry is made (i can add more sophisticated checks later), but the idea is to recycle... (11 Replies)
Discussion started by: serverchief
11 Replies

8. UNIX Desktop Questions & Answers

AIX how to read the file in function again and again

dear friends I have a wrote a shell script which works like this. 1.) a command is executed and the log is moved in the file. 2.) this file is copied in to the other file. 3.) used a grep command to find a particular word. 4.) if a particular word is there then the script will go to next... (4 Replies)
Discussion started by: aboy212u
4 Replies

9. Shell Programming and Scripting

[Bash] Read History function & Read Arrowkeys

Hi. How can I create a history function? (By "read" command or so) & How can I configure a read command so that the arrow keys are not displayed so funny? (^[[A) Thanks in advance. (4 Replies)
Discussion started by: sinnlosername
4 Replies

10. Shell Programming and Scripting

While read won't run keyboard function

I am using while read do/ done to retrieve menu item. Works as advertised, no problem. I am using this hack function "pause" to stop script execution and wait for keyboard "enter" key to continue. Sort of break point function. Also works fine with one exception - it does not work when used... (4 Replies)
Discussion started by: annacreek
4 Replies
mb(9r)																	    mb(9r)

NAME
mb - General: Performs a memory barrier SYNOPSIS
void mb( void ); ARGUMENTS
None DESCRIPTION
The Alpha architecture does not guarantee read/write ordering. That is, the memory subsystem is free to complete read and write operations in any order that is optimal, without regard for the order in which they were issued. Read/write ordering is not the same as cache coherency, which is handled separately and is not an issue. The Alpha architecture also contains a write buffer (as do many high-perfor- mance RISC CPUs, including the MIPS R3000). This write buffer can coalesce multiple writes to identical or adjacent addresses into a single write, effectively losing earlier write requests. Similarly, multiple reads to the same identical or adjacent addresses can be coalesced into a single read. This coalescing has implications for multiprocessor systems, as well as systems with off-board I/O or DMA engines that can read or modify memory asynchronously or that can require multiple writes to actually issue multiple data items. The mb (memory barrier) routine guarantees ordering of operations. The mb routine is derived from the MB instruction, which is described in the Alpha Architecture Reference Manual. The mb routine is a superset of the wbflush routine that ULTRIX drivers use. For compatibility, wbflush is aliased to mb on Tru64 UNIX Alpha systems. You call mb in a device driver under the following circumstances: To force a barrier between load/store operations After the CPU has pre- pared a data buffer in memory and before the device driver tries to perform a DMA out of the buffer Before attempting to read any device CSRs after taking a device interrupt Between writes Device drivers and the operating system are the primary users of the mb routine. However, some user programs, such as a graphics program that directly maps the frame buffer and manipulates registers, might need to call mb. The operating system does not provide a C library routine for mb. User programs that require use of mb should use the following asm construct: #include <c_asm.h> asm ("mb"); NOTES
In most situations that would require a cache flush on other CPU architectures, you should call the mb routine on Tru64 UNIX Alpha systems. The reason is not that mb is equivalent to a cache flush (as it is not). Rather, a common reason for doing a cache flush is to make data that the host CPU wrote available in main memory for access by the DMA device or to access from the host CPU data that was put in main mem- ory by a DMA device. In each case, on an Alpha CPU you should use a memory barrier to synchronize with that event. One example of using mb occurs with an Ethernet network controller. Each Ethernet network controller has a unique Ethernet hardware address that is typically contained in a ROM on the Ethernet controller board. The Ethernet hardware address is a multibyte sequence typically con- sisting of at least 10 bytes. This multibyte Ethernet hardware address is frequently read from the controller hardware by the driver's probe routine by issuing a sequence of reads to the same controller register. Each successive read returns the next byte of the Ethernet hardware address. In such instances, a call to mb should be inserted between each of these read operations to ensure that successive read operations are not coalesced into fewer actual reads as seen by the Ethernet controller. RETURN VALUES
None mb(9r)
All times are GMT -4. The time now is 05:06 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy