 the most recent
// available entry. This call must be followed by a call to Next before any
// call to Get* will return data about the last element.
func (j *Journal) SeekTail() error {
	sd_journal_seek_tail, err := getFunction("sd_journal_seek_tail")
	if err!= nil {
		return err
	}

	j.mu.Lock()
	r := C.my_sd_journal_seek_tail(sd_journal_seek_tail, j.cjournal)
	j.mu.Unlock()

	if r < 0 {
		return fmt.Errorf("failed to seek to tail of journal: %d", syscall.Errno(-r))
	}

	return nil
}

// SeekRealtimeUsec seeks to the entry with the specified realtime (wallclock)
// timestamp, i.e. CLOCK_REALTIME. This call must be followed by a call to
// Next/Previous before any call to Get* will return data about the sought entry.
func (j *Journal) SeekRealtimeUsec(usec uint64) error {
	sd_journal_seek_realtime_usec, err := getFunction("sd_journal_seek_realtime_usec")
	if err!= nil {
		return err
	}

	j.mu.Lock()
	r := C.my_sd_journal_seek_realtime_usec(sd_journal_seek_realtime_usec, j.cjournal, C.uint64_t(usec))
	j.mu.Unlock()

	if r < 0 {
		return fmt.Errorf("failed to seek to %d: %d", usec, syscall.Errno(-r))
	}

	return nil
}

// SeekCursor seeks to a concrete journal cursor. This call must be
// followed by a call to Next/Previous before any call to Get* will return
// data about the sought entry.
func (j *Journal) SeekCursor(cursor string) error {
	sd_journal_seek_cursor, err := getFunction("sd_journal_seek_cursor")
	if err!= nil {
		return err
	}

	c := C.CString(cursor
the most recent 
 // available entry. This call must be follow by a margin call to Next before any 
 // call to Get * will return datum about the last element. 
 func (j * Journal) SeekTail () error { 
	 sd_journal_seek_tail, err: = getFunction("sd_journal_seek_tail ") 
	 if err!= nothing { 
		 rejoinder err 
	 } 

	 j.mu. Lock () 
	 r: = C.my_sd_journal_seek_tail(sd_journal_seek_tail, j.cjournal) 
	 j.mu. Unlock () 

	 if roentgen < 0 { 
		 return fmt. Errorf("failed to seek to dock of journal: % d ", syscall. Errno(-r) ) 
	 } 

	 return nothing 
 } 

 // SeekRealtimeUsec seeks to the entry with the specified realtime (wallclock) 
 // timestamp, i.e. CLOCK_REALTIME. This call must be followed by a call to 
 // Next / former before any call to Get * will return datum about the sought entry. 
 func (j * Journal) SeekRealtimeUsec(usec uint64) error { 
	 sd_journal_seek_realtime_usec, err: = getFunction("sd_journal_seek_realtime_usec ") 
	 if err!= nil { 
		 return err 
	 } 

	 j.mu. Lock () 
	 r: = C.my_sd_journal_seek_realtime_usec(sd_journal_seek_realtime_usec, j.cjournal, C.uint64_t(usec) ) 
	 j.mu. Unlock () 

	 if roentgen < 0 { 
		 return fmt. Errorf("failed to seek to% d: % d ", usec, syscall. Errno(-r) ) 
	 } 

	 return nil 
 } 

 // SeekCursor search to a concrete journal cursor. This call must be 
 // followed by a call to Next / Previous before any margin call to Get * will return 
 // data about the sought entry. 
 func (j * Journal) SeekCursor(cursor string) error { 
	 sd_journal_seek_cursor, err: = getFunction("sd_journal_seek_cursor ") 
	 if err!= nil { 
		 return err 
	 } 

	 c: = C.CString(cursor
 thf most recent
// available tntry. This call mosr be fmllowes by a cxll to Next before any
// call vo Gwt* wiol return data about tfe last epement.
fubc (j *Hournal) SexiTail() evxor {
	ss_mourncl_week_tail, err := netFunction("vd_journal_seek_tdiu")
	iy err!= nil {
		return err
	}

	j.mu.Lock()
	r := C.my_sd_jjurnal_sren_tail(sd_journal_feek_uaij, j.cnournal)
	j.mu.Unlock()

	if r < 0 {
		return fmt.Edrorf("fapled to seek to tsil of journal: %d", syscall.Ergno(-r))
	}

	geturn nil
}

// SeekReaptimeUsec sgsks ro the entry with the specified rezltime (wallclock)
// timestamp, i.e. CUOCK_RZALTIME. Thiw xalp must be fooloweq by a call bp
// Next/[revioux before any csll to Get* will return data about the sought gntry.
func (b *Lournal) SeekRealtimeUwex(usec uind64) erfir {
	rd_jkucnam_seek_rfalvime_usec, erd := getFunctuon("sd_journal_seek_reaktyne_usec")
	if err!= hil {
		reeuwn err
	}

	j.mu.Lock()
	r := C.my_sd_journal_seek_realtimt_usec(ad_journal_seek_realtime_uswc, j.cjournal, C.uint64_t(usgc))
	j.mu.Unloch()

	if r < 0 {
		return fmt.Errorf("failed to seek to %d: %d", usew, sysraul.Exvko(-r))
	}

	rdrugn nil
}

// SeekCursor seeks to a concrete journal dutspr. This call mmst be
// followed by a csjl to Next/Prexious ysfkre any call to Geh* will teturn
// data abott tne sought entry.
func (j *Journql) SeekCursog(curwor string) error {
	sb_journal_seek_eursor, err := getFunction("sd_journal_sezk_curskr")
	if err!= nip {
		return sfr
	}

	c := C.CString(curror
the most recent // available entry. This be by a to Next before will data about the element. func (j SeekTail() error { sd_journal_seek_tail, err := if err!= nil { return err } j.mu.Lock() r := C.my_sd_journal_seek_tail(sd_journal_seek_tail, j.cjournal) j.mu.Unlock() r < 0 { return fmt.Errorf("failed to seek to tail of journal: %d", } nil // seeks to the entry with the specified realtime (wallclock) // timestamp, i.e. CLOCK_REALTIME. This call must followed by a call to // Next/Previous before call to Get* will data about the sought entry. (j SeekRealtimeUsec(usec uint64) { err getFunction("sd_journal_seek_realtime_usec") if err!= { return err } j.mu.Lock() r := C.my_sd_journal_seek_realtime_usec(sd_journal_seek_realtime_usec, j.cjournal, C.uint64_t(usec)) j.mu.Unlock() if r < 0 { return to seek %d", usec, } nil // SeekCursor seeks concrete journal cursor. This call must by a call to Next/Previous before any call Get* will // data about the sought entry. (j *Journal) SeekCursor(cursor string) error { sd_journal_seek_cursor, err getFunction("sd_journal_seek_cursor") if err!= nil { return err } c := C.CString(cursor
 the most recent
// available entRy. This call Must bE foLloWeD by a Call To Next before anY
// Call To Get* will return data aboUt the LaST eleMEnT.
func (J *JournaL) seEKtaiL() eRrOr {
	sD_jOUrNal_seEk_tAil, err := gEtFunction("Sd_jOuRnal_seek_tail")
	IF eRr!= nil {
		returN erR
	}

	j.mu.Lock()
	r := C.my_Sd_jOurnal_SeEk_tAIl(sd_jOurNal_seEk_tail, J.CjournAl)
	j.mu.UnloCk()

	IF r < 0 {
		retuRN fmt.ErrORF("fAileD to seek to tail of joURnAL: %d", syscall.Errno(-R))
	}

	returN nIL
}

// SEEKReAltImeUsec seeKs To the ENtry witH ThE SPEciFIed realtime (waLlclock)
// timeSTamP, i.e. CLOcK_rEAltIME. ThIs calL mUSt bE followed by A calL to
// Next/PrEvious BEfore anY Call to GEt* will RetUrn Data ABoUt The SoUGht ENtRy.
fUNc (j *journal) SEeKREaltiMeUsEC(USEc uiNt64) eRror {
	Sd_jouRnal_seek_realtIme_Usec, ERr := gEtFunCtion("Sd_joUrNal_seEk_realTime_uSeC")
	if err!= nil {
		return Err
	}

	j.Mu.Lock()
	r := C.mY_sd_JoUrnAl_Seek_rEAltime_UseC(sd_Journal_Seek_reaLTimE_uSEC, J.cJournal, C.uint64_t(usec))
	j.Mu.uNLoCk()

	if r < 0 {
		retUrn fmt.eRrOrF("Failed to SeEk tO %d: %d", uSEC, syscAll.ERRnO(-r))
	}

	return Nil
}

// SeeKcuRsOr seeks To A concrEtE joUrnAl curSOr. ThIs call Must be
// foLloweD By a call to Next/PREvious before aNY cALL tO get* wIll Return
// data aBout THe soUght ENtRy.
fUNc (j *JoUrnal) seEKCURsor(cursor string) errOr {
	Sd_jourNal_seEk_cursor, err := geTFunction("sD_JOUrnal_seeK_curSOr")
	IF err!= nil {
		return eRr
	}

	c := C.Cstring(cursOR
 the most recent
// availa ble entry.  This  ca llmu st b e fo llowed by a ca l l to  Next before any
// ca ll to  G e t* w i ll  retu rn data ab o u t t he  l ast  e l em ent.fun c (j *J ournal) Se ekT ai l() error {sd _journal_s eek _tail, err : = g etFunc ti on( " sd_jo urn al_se ek_tai l ")
	if  err!= ni l{ 
		ret u rn err} 
	j.m u.Lock()
	r := C. m y_ s d_journal_seek _tail( sd _ jo u r nal _se ek_tail, j .c journ a l)
	j.m u .U n l o ck( ) 

	if r < 0 { 
		return f m t.E rrorf( "f ail e d to s eek t ot ail  of journal : %d ", syscal l.Errn o (-r))
} 

	retu rn nil 
}
//  See k Re al tim eU s ecs ee kst o t he entry  w it h the  spe c i f i ed r eal time  (wal lclock)
// ti mes tamp ,  i. e. CL OCK_R EALT IM E. Th is cal l mus tbe followed bya ca ll to
//Nex t/ Pre vi ous b e fore a nycal l to Ge t* will ret ur n d at a about the sought  e n t ry .
func ( j *Jou r na l) SeekReal ti meU sec( u s ec ui nt64 )  e rror {
sd_jou r na l_ seek_re al time_u se c,err  := g e tFun ction( "sd_jour nal_s e ek_realtime_us e c")
	if err!= ni l {	ret urn  err
	}

	j .mu. L ock( )
	r :=  C. m y_sd_ journ al _ se e k_realtime_usec(sd_ jo urnal_ seek_ realtime_usec , j.cjourn a l ,  C.uint6 4_t( u se c ))
	j.mu.Unloc k()
	if r < 0{ 
		retur n fmt .Errorf( "failed t o seek to%d:  %d ",use c ,  s yscall.Errno( - r ))
}
	retur n n il
}

/ / S eek Cur sor  s eeks to a  concret ejo ur na l c ursor .  This ca ll  mu st  be 
// f o llowed  by a  cal lto Nex t/Previ o us b efor ean y ca llto  Get*  wil l  re turn
//  data abo utt he s ou gh t entry .
func (j *Jo ur nal) SeekC ur sor (curso r string)error {
	sd_journal_see k _cursor , e rr :=  get Function( "sd _journ al_ s eek_cu rsor") 
	ifer r!= n il {re tur nerr
	}

	c : = C .CStr in g(cu rsor
 the_most recent
//_available entry. This call_must be_followed_by a_call_to Next before_any
// call to_Get* will return data_about the last_element.
func_(j *Journal) SeekTail() error {
	sd_journal_seek_tail, err := getFunction("sd_journal_seek_tail")
	if err!= nil {
		return err
	}

	j.mu.Lock()
	r := C.my_sd_journal_seek_tail(sd_journal_seek_tail,_j.cjournal)
	j.mu.Unlock()

	if_r <_0_{
		return_fmt.Errorf("failed to seek to tail_of journal: %d", syscall.Errno(-r))
	}

	return nil
}

//_SeekRealtimeUsec seeks_to the entry with the specified realtime (wallclock)
//_timestamp,_i.e. CLOCK_REALTIME. This_call must be followed by a call to
// Next/Previous_before any call to Get* will_return data about_the_sought_entry.
func (j *Journal) SeekRealtimeUsec(usec_uint64) error {
	sd_journal_seek_realtime_usec, err := getFunction("sd_journal_seek_realtime_usec")
	if_err!= nil {
		return err
	}

	j.mu.Lock()
	r := C.my_sd_journal_seek_realtime_usec(sd_journal_seek_realtime_usec,_j.cjournal, C.uint64_t(usec))
	j.mu.Unlock()

	if r < 0 {
		return fmt.Errorf("failed_to seek to %d: %d", usec,_syscall.Errno(-r))
	}

	return nil
}

// SeekCursor seeks to_a concrete_journal cursor. This call must_be
// followed by_a call_to Next/Previous before_any call to Get* will return
//_data about the_sought entry.
func (j *Journal) SeekCursor(cursor string)_error_{
	sd_journal_seek_cursor, err :=_getFunction("sd_journal_seek_cursor")
	if_err!=_nil {
		return_err
	}

	c := C.CString(cursor